Class JobBuilder

java.lang.Object
com.avoka.tm.svc.JobBuilder

public class JobBuilder extends Object

Provides a Job value object builder class.

This class builds a Collaboration Job that is associated with the client of the job controller svc.

NOTE: to create a job from a Txn, the Txn needs to be submitted. It will use the Job Controller associated with the Txn's form version. The TxnUpdater can be used to submit a form by setting the formStatus to Txn.FORM_COMPLETED.

Examples

Please find job builder example below.

Create an Job

Build a job given the job controller service and version. reference number is optional but if specified must be unique

 import com.avoka.tm.svc.*
 import com.avoka.tm.vo.*

 Job job1 = new JobBuilder()
                  .setSvcName('1 Step Review')
                  .setSvcVersion('0.1.0')
                  .setReferenceNumber('ABC123')
                  .setProcessJobAfterCreate(true)
                  .build()
 

Create an Job from the current version

Build a job given the job controller service name, the current version is used reference number is optional but if specified must be unique

 import com.avoka.tm.svc.*
 import com.avoka.tm.vo.*

 Job job2 = new JobBuilder()
                  .setSvnName('1 Step Review')
                  .setReferenceNumber('ABC123')
                  .setProcessJobAfterCreate(true)
                  .build()
 

Creating a job and associating it with an Opened or Saved Txn can be done through setInitialTxnTrackingCode(java.lang.String).

Note: This requires the Job Controller to be associated with the Txn's form version, and Job Controller service has the "allowEarlyCreation" flag set to true in its job definition. Setting on processJobAfterCreate for the job will be ignored.

Examples

Please find job builder example below.

Create a job given the job controller service and version for a non submitted Txn as the initial Txn

 import com.avoka.tm.svc.*
 import com.avoka.tm.vo.*
 Job job3 = new JobBuilder()
                  .setSvcName('1 Step Review')
                  .setSvcVersion('0.1.0')
                  .setReferenceNumber('ABC123')
                  .setInitialTxnTrackingCode('ABC123')
                  .build()
 
Since:
19.11.0
See Also:
  • Constructor Details

  • Method Details

    • setInitialTxnTrackingCode

      public JobBuilder setInitialTxnTrackingCode(String initialTxnTrackingCode)
      Set the Txn's trackingCode to associate with the job as its initial Txn. Supported Txn status: [ Opened | Saved ]
      Parameters:
      initialTxnTrackingCode - the initial txn tracking code to associated with (required)
      Returns:
      the job builder
      Since:
      24.10.0
    • setProcessJobAfterCreate

      public JobBuilder setProcessJobAfterCreate(Boolean processJob)
      Set the job to process job after creation.
      Parameters:
      processJob - if true will process job after creation
      Returns:
      the job builder
    • setSvcName

      public JobBuilder setSvcName(String svcName)
      Set the job controller service name parameter.
      Parameters:
      svcName - the name of the job controller service
      Returns:
      the job builder
    • setSvcVersion

      public JobBuilder setSvcVersion(String svcVersion)
      Set the job controller service version parameter. If the svcVersion is not set or set to a blank value it will use the current service for the svcName specified.
      Parameters:
      svcVersion - the version of the job controller service
      Returns:
      the job builder
    • setReferenceNumber

      public JobBuilder setReferenceNumber(String referenceNumber)
      Set the reference number parameter.
      Parameters:
      referenceNumber - the reference number of the created job
      Returns:
      the job builder
    • build

      public Job build()
      Create a Job based on the specified parameter and return the new Job value object.
      Returns:
      the newly created Job value object