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 which is not started from a Txn submission. Note the job 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()
 
Since:
19.11.0
See Also:
  • Constructor Details

  • Method Details

    • 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