Class CreationWorkflowDefinition
You get an instance from api.newCreationWorkflow()
in a logic whose nature is Creation Workflow, add steps created by
api.newCreationWorkflowStep(),
and return it as the element result. The result of the first element that returns a CreationWorkflowDefinition
is used as the definition of the Creation Workflow. If the returned definition has no steps, the Creation Workflow
finishes immediately.
The logic runs again each time the workflow starts, each time a user moves the document to the next or previous step, and optionally when the document is saved, so you build the steps in every execution.
Example:
def step1 = api.newCreationWorkflowStep()
.withLabel("Add Products")
.withUserAssignee("Bill.Greene")
def step2 = api.newCreationWorkflowStep()
.withLabel("Input params")
.withUserGroupAssignee("SalesEMEA")
return api.newCreationWorkflow()
.withSteps(step1, step2)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetSteps()Retrieves a list of all steps in the given workflow.voidresetCurrentStepTo(int step) Switches the Creation Workflow to the specified step, ignores what the user clicked in the user interface.withSteps(CreationWorkflowStepDefinition... steps) Adds specified steps (must be already defined within the logic) to the Creation Workflow.
-
Constructor Details
-
CreationWorkflowDefinition
public CreationWorkflowDefinition()
-
-
Method Details
-
getSteps
Retrieves a list of all steps in the given workflow.The steps are returned in the order in which they were added by
withSteps(CreationWorkflowStepDefinition...). The position of a step in the list is its step index (starting at 0), which is the value used byresetCurrentStepTo(int). The method never returnsnull; the list is empty when no steps were added. The returned list is the workflow's own list, not a copy, so changes to it change the workflow definition.Example:
def cwf = api.newCreationWorkflow() .withSteps(step1, step2) def stepCount = cwf.getSteps().size() // 2- Returns:
- a list of
CreationWorkflowStepDefinitionobjects. - Since:
- 3.4.0 - Cuba Libre
- See Also:
-
withSteps
Adds specified steps (must be already defined within the logic) to the Creation Workflow.The steps are appended in the given order after any steps added earlier, so calling this method repeatedly adds more steps. The order determines the sequence in which the document moves through the workflow.
Example:
return api.newCreationWorkflow() .withSteps(step1, step2, step3)- Parameters:
steps- The list of steps (CreationWorkflowStepDefinition).- Returns:
- The
CreationWorkflowDefinitionobject with given steps. - Since:
- 3.4.0 - Cuba Libre
- See Also:
-
resetCurrentStepTo
public void resetCurrentStepTo(int step) Switches the Creation Workflow to the specified step, ignores what the user clicked in the user interface.The step index starts at 0 and refers to the position of the step in
getSteps(). The switch is applied after the logic finishes:- If
stepis lower than the number of steps, the Creation Workflow is set to In Progress and moves to that step. - If
stepis equal to or greater than the number of steps, the Creation Workflow is set to Finished.
Example:
def creationWF = api.newCreationWorkflow() .withSteps(costsStep, pricingStep) creationWF.resetCurrentStepTo(1) // move to "pricingStep" return creationWF- Parameters:
step- The number of a step you want to switch the Creation Workflow to.- Since:
- 3.4.5 - Cuba Libre PR5
- See Also:
- If
-
getRequestedCurrentStep
-