Class CreationWorkflowStepDefinition
- Direct Known Subclasses:
ReviewStepDefinition
You get an instance from api.newCreationWorkflowStep()
in a Creation Workflow logic, configure it with the with... methods, and add it to the workflow with
CreationWorkflowDefinition.withSteps(CreationWorkflowStepDefinition...).
The with... methods replace the value set by an earlier call of the same kind; they do not add to it.
When a step has both user assignees and user group assignees, all of them are assigned to the step.
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 TypeMethodDescriptiongetLabel()Retrieves the label of the Creation Workflow step (theCreationWorkflowStepDefinitionobject).booleanReturns the value of theshouldSendNotificationfield.Deprecated.Retrieves users assigned (userAssignees) to the Creation Workflow Step.Deprecated.UsegetUserGroupAssignees()instead, which returns all assigned user groups.Retrieves user groups assigned to the Creation Workflow Step.Retrieves watcher user groups (userGroupWatchers) from the Creation Workflow Step.Retrieves watchers (userWatchers) from the Creation Workflow Step.Sets the label of the Creation Workflow step (theCreationWorkflowStepDefinitionobject).
The label is shown to users in the user interface and can be up to 255 characters long.
Example:withShouldSendNotification(boolean shouldSendNotification) Set tofalseto not send email notifications to the assignees and watchers of this step when the Creation Workflow moves to this step.
Default:truewithUserAssignee(String userAssigneeLoginName) Assigns a user to the Creation Workflow Step.withUserAssignees(String... userAssigneeLoginName) Assigns one or more users to the Creation Workflow Step.withUserGroupAssignee(String userGroupAssigneeUniqueName) Assigns a user group to the Creation Workflow Step.withUserGroupAssignees(String... userGroupAssigneeUniqueNames) Assigns one or more user groups to the Creation Workflow Step.withUserGroupWatchers(String... userGroupWatcherUniqueNames) Assigns user group(s) as watchers to the Creation Workflow Step.
Watchers are notified by email when the Creation Workflow moves to this step and when it finishes on this step.withUserWatchers(String... userWatcherLoginNames) Adds users as watchers to the Creation Workflow Step.
Watchers are notified by email when the Creation Workflow moves to this step and when it finishes on this step.
-
Constructor Details
-
CreationWorkflowStepDefinition
public CreationWorkflowStepDefinition()
-
-
Method Details
-
getLabel
Retrieves the label of the Creation Workflow step (theCreationWorkflowStepDefinitionobject).Example:
def step = api.newCreationWorkflowStep() .withLabel("Add Products") def label = step.getLabel() // "Add Products"- Returns:
- The label of the given Creation Workflow step, or
nullif no label was set. - Since:
- 3.4.0 - Cuba Libre
- See Also:
-
withLabel
Sets the label of the Creation Workflow step (theCreationWorkflowStepDefinitionobject).
The label is shown to users in the user interface and can be up to 255 characters long.
Example:def step1 = api.newCreationWorkflowStep() .withLabel("The Step One") .withUserAssignees("admin", "john.price")- Parameters:
label- The label as a string.- Returns:
- The
CreationWorkflowStepDefinitionobject with the given label. - Since:
- 3.4.0 - Cuba Libre
- See Also:
-
getUserAssignee
Deprecated.UsegetUserAssignees()instead, which returns all assigned users.Retrieves the login name of the first user assigned to the Creation Workflow Step.- Returns:
- The login name of the first user assignee, or
nullif no user is assigned.
-
getUserAssignees
Retrieves users assigned (userAssignees) to the Creation Workflow Step.Example:
def step = api.newCreationWorkflowStep() .withUserAssignees("admin", "john.price") def assignees = step.getUserAssignees() // ["admin", "john.price"]- Returns:
- The login names of the assigned users as a list of
String. The list is empty (nevernull) when no user is assigned, and it cannot be modified. - Since:
- 3.5.2 - Salty Dog PR2
- See Also:
-
withUserAssignee
Assigns a user to the Creation Workflow Step.Replaces any users assigned earlier by this method or by
withUserAssignees(String...).Example:
def step1 = api.newCreationWorkflowStep() .withLabel("Add Products") .withUserAssignee("Bill.Greene")- Parameters:
userAssigneeLoginName- The login name of the user you want to assign to the Creation Workflow Step.- Returns:
- The
CreationWorkflowStepDefinitionobject with the specifieduserAssignee. - Since:
- 3.4.0 - Cuba Libre
- See Also:
-
withUserAssignees
Assigns one or more users to the Creation Workflow Step.Replaces any users assigned earlier by this method or by
withUserAssignee(String).Example:
def step1 = api.newCreationWorkflowStep() .withLabel("The Step One") .withUserAssignees("admin", "john.price")- Parameters:
userAssigneeLoginName- The login name(s) of the user(s) you want to assign to the Creation Workflow Step.- Returns:
- The
CreationWorkflowStepDefinitionobject containing specifieduserAssigneesas a list. - Since:
- 3.5.2 - Salty Dog PR2
- See Also:
-
withUserWatchers
Adds users as watchers to the Creation Workflow Step.
Watchers are notified by email when the Creation Workflow moves to this step and when it finishes on this step. Replaces any user watchers set earlier by this method.
Example:def step1 = api.newCreationWorkflowStep() .withLabel("The Step One") .withUserAssignees("admin", "john.price") .withUserWatchers("john.doe", "anna.broke")- Parameters:
userWatcherLoginNames- The login name(s) of the user(s) you want to assign as watchers to the Creation Workflow Step.- Returns:
- The
CreationWorkflowStepDefinitionobject containing specifieduserWatchersas a list. - Since:
- 3.6.0 - El Presidente
- See Also:
-
withUserGroupWatchers
Assigns user group(s) as watchers to the Creation Workflow Step.
Watchers are notified by email when the Creation Workflow moves to this step and when it finishes on this step. Replaces any user group watchers set earlier by this method.
Example:def step1 = api.newCreationWorkflowStep() .withLabel("The Step One") .withUserAssignees("admin", "john.price") .withUserGroupWatchers("Pricing Managers", "Marketing")- Parameters:
userGroupWatcherUniqueNames- The unique name(s) of the user group(s) you want to assign as watchers to the Creation Workflow Step.- Returns:
- The
CreationWorkflowStepDefinitionobject containing specifieduserGroupWatchersas a list. - Since:
- 3.6.0 - El Presidente
- See Also:
-
getUserWatchers
Retrieves watchers (userWatchers) from the Creation Workflow Step.Example:
def step = api.newCreationWorkflowStep() .withUserWatchers("john.doe", "anna.broke") def watchers = step.getUserWatchers() // ["john.doe", "anna.broke"]- Returns:
- The login names of the user watchers as a list of
String. The list is empty (nevernull) when no user watcher is set, and it cannot be modified. - Since:
- 3.6.0 - El Presidente
- See Also:
-
getUserGroupWatchers
Retrieves watcher user groups (userGroupWatchers) from the Creation Workflow Step.Example:
def step = api.newCreationWorkflowStep() .withUserGroupWatchers("Pricing Managers", "Marketing") def groupWatchers = step.getUserGroupWatchers() // ["Pricing Managers", "Marketing"]- Returns:
- The unique names of the watcher user groups as a list of
String. The list is empty (nevernull) when no user group watcher is set, and it cannot be modified. - Since:
- 3.6.0 - El Presidente
- See Also:
-
getUserGroupAssignee
Deprecated.UsegetUserGroupAssignees()instead, which returns all assigned user groups.Retrieves the unique name of the first user group assigned to the Creation Workflow Step.- Returns:
- The unique name of the first user group assignee, or
nullif no user group is assigned.
-
getUserGroupAssignees
Retrieves user groups assigned to the Creation Workflow Step.Example:
def step = api.newCreationWorkflowStep() .withUserGroupAssignees("SalesEMEA", "SalesAPAC") def groups = step.getUserGroupAssignees() // ["SalesEMEA", "SalesAPAC"]- Returns:
- The unique names of the assigned user groups as a list of
String. The list is empty (nevernull) when no user group is assigned, and it cannot be modified. - Since:
- 3.5.2 - Salty Dog PR2
- See Also:
-
withUserGroupAssignee
Assigns a user group to the Creation Workflow Step.Replaces any user groups assigned earlier by this method or by
withUserGroupAssignees(String...).Example:
def step2 = api.newCreationWorkflowStep() .withLabel("Input params") .withUserGroupAssignee("SalesEMEA")- Parameters:
userGroupAssigneeUniqueName- The unique name of the user group you want to assign to the Creation Workflow Step.- Returns:
- The
CreationWorkflowStepDefinitionobject including the specifieduserGroupAssignee. - Since:
- 3.5.2 - Salty Dog PR2
- See Also:
-
withUserGroupAssignees
public CreationWorkflowStepDefinition withUserGroupAssignees(String... userGroupAssigneeUniqueNames) Assigns one or more user groups to the Creation Workflow Step.Replaces any user groups assigned earlier by this method or by
withUserGroupAssignee(String).Example:
def step2 = api.newCreationWorkflowStep() .withLabel("Input params") .withUserGroupAssignees("SalesEMEA", "SalesAPAC")- Parameters:
userGroupAssigneeUniqueNames- A list of user group unique names you want to assign to the Creation Workflow Step.- Returns:
- The
CreationWorkflowStepDefinitionobject including the specifieduserGroupAssignees. - Since:
- 3.4.0 - Cuba Libre
- See Also:
-
getShouldSendNotification
public boolean getShouldSendNotification()Returns the value of theshouldSendNotificationfield.Example:
def step = api.newCreationWorkflowStep() .withShouldSendNotification(false) def notify = step.getShouldSendNotification() // false- Returns:
true(the default) if email notifications are sent to the assignees and watchers of this step,falseif they are suppressed.- Since:
- 3.4.0 - Cuba Libre
- See Also:
-
withShouldSendNotification
Set tofalseto not send email notifications to the assignees and watchers of this step when the Creation Workflow moves to this step.
Default:trueNotifications are sent only if the corresponding message templates are enabled. Because the logic runs again on every execution, you can compute the value, for example to skip the notification on the first save of a new document (its
typedIdisnulluntil it is saved).Example:
def step1 = api.newCreationWorkflowStep() .withLabel("Creator step") .withUserAssignee(creator.loginName) .withShouldSendNotification(api.currentItem("typedId") != null)- Parameters:
shouldSendNotification- true (default), or false.- Returns:
- The
CreationWorkflowStepDefinitionobject withshouldSendNotificationboolean value set as specified. - Since:
- 3.4.0 - Cuba Libre
- See Also:
-
getUserAssignees()instead, which returns all assigned users.