Class CreationWorkflowStepDefinition

Object
CreationWorkflowStepDefinition
Direct Known Subclasses:
ReviewStepDefinition

public class CreationWorkflowStepDefinition extends Object
Defines one step of a document Creation Workflow: its label, the users and user groups assigned to work on the document in this step, the watchers, and whether email notifications are sent.

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 Details

    • CreationWorkflowStepDefinition

      public CreationWorkflowStepDefinition()
  • Method Details

    • getLabel

      public String getLabel()
      Retrieves the label of the Creation Workflow step (the CreationWorkflowStepDefinition object).

      Example:

      
       def step = api.newCreationWorkflowStep()
               .withLabel("Add Products")
      
       def label = step.getLabel()  // "Add Products"
       
      Returns:
      The label of the given Creation Workflow step, or null if no label was set.
      Since:
      3.4.0 - Cuba Libre
      See Also:
    • withLabel

      public CreationWorkflowStepDefinition withLabel(String label)
      Sets the label of the Creation Workflow step (the CreationWorkflowStepDefinition object).
      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 CreationWorkflowStepDefinition object with the given label.
      Since:
      3.4.0 - Cuba Libre
      See Also:
    • getUserAssignee

      @Deprecated public String getUserAssignee()
      Deprecated.
      Use getUserAssignees() 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 null if no user is assigned.
    • getUserAssignees

      public List<String> 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 (never null) when no user is assigned, and it cannot be modified.
      Since:
      3.5.2 - Salty Dog PR2
      See Also:
    • withUserAssignee

      public CreationWorkflowStepDefinition withUserAssignee(String userAssigneeLoginName)
      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 CreationWorkflowStepDefinition object with the specified userAssignee.
      Since:
      3.4.0 - Cuba Libre
      See Also:
    • withUserAssignees

      public CreationWorkflowStepDefinition withUserAssignees(String... userAssigneeLoginName)
      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 CreationWorkflowStepDefinition object containing specified userAssignees as a list.
      Since:
      3.5.2 - Salty Dog PR2
      See Also:
    • withUserWatchers

      public CreationWorkflowStepDefinition 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. 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 CreationWorkflowStepDefinition object containing specified userWatchers as a list.
      Since:
      3.6.0 - El Presidente
      See Also:
    • withUserGroupWatchers

      public CreationWorkflowStepDefinition 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. 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 CreationWorkflowStepDefinition object containing specified userGroupWatchers as a list.
      Since:
      3.6.0 - El Presidente
      See Also:
    • getUserWatchers

      public List<String> 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 (never null) when no user watcher is set, and it cannot be modified.
      Since:
      3.6.0 - El Presidente
      See Also:
    • getUserGroupWatchers

      public List<String> 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 (never null) when no user group watcher is set, and it cannot be modified.
      Since:
      3.6.0 - El Presidente
      See Also:
    • getUserGroupAssignee

      @Deprecated public String getUserGroupAssignee()
      Deprecated.
      Use getUserGroupAssignees() 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 null if no user group is assigned.
    • getUserGroupAssignees

      public List<String> 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 (never null) when no user group is assigned, and it cannot be modified.
      Since:
      3.5.2 - Salty Dog PR2
      See Also:
    • withUserGroupAssignee

      public CreationWorkflowStepDefinition withUserGroupAssignee(String userGroupAssigneeUniqueName)
      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 CreationWorkflowStepDefinition object including the specified userGroupAssignee.
      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 CreationWorkflowStepDefinition object including the specified userGroupAssignees.
      Since:
      3.4.0 - Cuba Libre
      See Also:
    • getShouldSendNotification

      public boolean getShouldSendNotification()
      Returns the value of the shouldSendNotification field.

      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, false if they are suppressed.
      Since:
      3.4.0 - Cuba Libre
      See Also:
    • withShouldSendNotification

      public CreationWorkflowStepDefinition withShouldSendNotification(boolean shouldSendNotification)
      Set to false to not send email notifications to the assignees and watchers of this step when the Creation Workflow moves to this step.
      Default: true

      Notifications 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 typedId is null until 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 CreationWorkflowStepDefinition object with shouldSendNotification boolean value set as specified.
      Since:
      3.4.0 - Cuba Libre
      See Also: