Class InsertWorkflowStepsDTO

Object
InsertWorkflowStepsDTO

public class InsertWorkflowStepsDTO extends Object
Lets a Workflow Post Step logic add approval or watcher steps to the running Approval Workflow. The steps you insert are added right after the Workflow Step whose post-step logic is being executed, in the order in which you insert them.

You never create this object yourself. In a logic of type Workflow with the Post Step nature (wfStepLogic), it is available as the currentWorkflow binding variable, next to workflowHistory (the steps processed so far) and approvable (the document being approved). The binding is only available when the document has a workflow defined.

Note: The inserted steps are only added when the post-step logic ends without an error. If the logic fails, all steps inserted during that run are discarded and the workflow continues with the next step. Steps are also ignored if the executed step was itself inserted by a post-step logic; in that case the attempt is only logged.

Example:


 if (workflowHistory.activeStep.approved) {
   currentWorkflow.insertApprovalStep("postAdded").withApprovers("user")
 }
 
Since:
3.2 - Mojito
See Also:
  • Constructor Details

    • InsertWorkflowStepsDTO

      public InsertWorkflowStepsDTO()
  • Method Details

    • insertApprovalStep

      public WorkflowDTO.ApprovalStepDTO insertApprovalStep(String uniqueName)
      Inserts an approval step right after workflow post logic step that is executing this code. Configure the returned step (approvers, reasons, post-step logic) by chaining its with* methods. If the inserted step has no post-step logic of its own, the workflow's default post-step logic runs after it; call .withPostStepLogic("") to disable it for this step.

      Example:

      
       currentWorkflow.insertApprovalStep("defaultPostAdded")
         .withApprovers("user")
         .withPostStepLogic("")
       
      Parameters:
      uniqueName - Name of the step
      Returns:
      The new approval step as a WorkflowDTO.ApprovalStepDTO, never null
      Since:
      3.2 - Mojito
      See Also:
    • insertWatcherStep

      public WorkflowDTO.WatcherStepDTO insertWatcherStep(String uniqueName)
      Inserts a watcher step right after workflow post logic step that is executing this code. A watcher step cannot approve or deny, but will receive a notification when it becomes active. Define who is notified by chaining the with*Watcher methods of the returned step.

      Example:

      
       if (workflowHistory.activeStep.denied) {
         currentWorkflow.insertWatcherStep("deniedWatcher")
           .withUserWatchers("admin")
       }
       
      Parameters:
      uniqueName - Name of the step
      Returns:
      The new watcher step as a WorkflowDTO.WatcherStepDTO, never null
      Since:
      3.2 - Mojito
      See Also:
    • getSteps

      public LinkedHashSet<WorkflowDTO.StepDTO> getSteps()
    • isPostStepLogicFailed

      public boolean isPostStepLogicFailed()
    • setPostStepLogicFailed

      public void setPostStepLogicFailed(boolean postStepLogicFailed)