Interface CompleteJobCommandStep1.CompleteJobCommandJobResultStep

All Known Implementing Classes:
CompleteJobCommandImpl
Enclosing interface:
CompleteJobCommandStep1

public static interface CompleteJobCommandStep1.CompleteJobCommandJobResultStep
  • Method Details

    • forUserTask

      Initializes the job result to allow corrections or a denial to be configured.

      This method is used to apply changes to user task attributes (such as assignee, priority, dueDate, and so on) or explicitly deny a user task lifecycle transition.

      Example usage:

      
       client.newCompleteJobCommand(jobKey)
           .withResult(r -> r.forUserTask()
            .correctAssignee("john_doe")                 // dynamically reassigns the task to 'john_doe'
            .correctPriority(84)                         // adjusts the priority of the task
            .correctDueDate("2024-11-22T11:44:55.0000Z")) // sets a new due date
            .send();
       
      Returns:
      the builder for this command.
    • forAdHocSubProcess

      Initialized the job result to allow activation of elements in an ad-hoc sub process.

      This method is used to activate elements as a followup of a job completion. It will activate elements by id and variables provided will be created in the scope of the created element.

      
       client.newCompleteJobCommand(jobKey)
        .withResult(r -> r.forAdHocSubProcess()
          .activateElement("elementId")           // Activate the element with id 'elementId'
          .variable("key", "value")               // Create variable in the scope of 'elementId'
          .activateElement("anotherElementId"))   // Activate another element with id 'anotherElementId'
          .variable("key", "value")               // Create a variable in the scope of 'anotherElementId'
          .send();
      
       
      Returns:
      the builder for this command.