Package net.pricefx.common.dto
Class InsertWorkflowStepsDTO
Object
InsertWorkflowStepsDTO
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSteps()insertApprovalStep(String uniqueName) Inserts an approval step right after workflow post logic step that is executing this code.insertWatcherStep(String uniqueName) Inserts a watcher step right after workflow post logic step that is executing this code.booleanvoidsetPostStepLogicFailed(boolean postStepLogicFailed)
-
Constructor Details
-
InsertWorkflowStepsDTO
public InsertWorkflowStepsDTO()
-
-
Method Details
-
insertApprovalStep
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 itswith*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, nevernull - Since:
- 3.2 - Mojito
- See Also:
-
insertWatcherStep
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 thewith*Watchermethods 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, nevernull - Since:
- 3.2 - Mojito
- See Also:
-
getSteps
-
isPostStepLogicFailed
public boolean isPostStepLogicFailed() -
setPostStepLogicFailed
public void setPostStepLogicFailed(boolean postStepLogicFailed)
-