Class ReviewStepDefinition


public class ReviewStepDefinition extends CreationWorkflowStepDefinition
A step in the Creation Workflow where line items are sent for review.

You get an instance from api.newReviewStep() in a Creation Workflow logic and add it to the workflow with CreationWorkflowDefinition.withSteps(CreationWorkflowStepDefinition...), together with the other steps. A review step defines:

Review steps are supported only in Quotes and Agreements/Promotions. If the Creation Workflow logic of any other document type returns a workflow that contains a review step, the workflow execution fails. If the document has no line items, the review step is skipped automatically. Since version 16.0, a Creation Workflow can contain more than one review step.

This class inherits the methods of CreationWorkflowStepDefinition. The assignees, watchers, and notification setting of a review step are processed in the same way as for any other step; the reviewers are defined by the review sub-steps.

Example:


 if (api.isSyntaxCheck()) return

 def reviewStep = api.newReviewStep()
     .withLabel("Review")
     .withLineItemFilters([
         "BusinessUnitPrinting"   : Filter.like("inputs.BusinessUnit.value", "Printing"),
         "BusinessUnitResidential": Filter.like("inputs.BusinessUnit.value", "Residential and Small Business")
     ])
     .withReviewByUserGroupWithSubSteps(
         api.newReviewByUserGroups()
             .withParallelSubSteps(
                 api.newReviewSubStep()
                     .withUserGroup("SupplyCoordinator")
                     .withLabel("Supply Coordinator"),
                 api.newReviewSubStep()
                     .withUserGroup("PricingAdvisor")
                     .withLabel("Pricing Advisor")
             )
     )

 return api.newCreationWorkflow()
     .withSteps(
         reviewStep,
         api.newCreationWorkflowStep()
             .withLabel("Final Approval")
     )
 
Since:
14.0 - Caribou Lou
See Also:
  • Constructor Details

    • ReviewStepDefinition

      public ReviewStepDefinition()
  • Method Details

    • withLabel

      public ReviewStepDefinition withLabel(String label)
      Sets the label of the review step. Behaves like CreationWorkflowStepDefinition.withLabel(String), but returns the review step, so you can continue with the review step methods in the same chain.

      Example:

      
       def reviewStep = api.newReviewStep()
           .withLabel("Review")
       
      Overrides:
      withLabel in class CreationWorkflowStepDefinition
      Parameters:
      label - The label as a string.
      Returns:
      The same ReviewStepDefinition object, for chaining.
      Since:
      14.0 - Caribou Lou
      See Also:
    • withReviewByUserGroupWithSubSteps

      public ReviewStepDefinition withReviewByUserGroupWithSubSteps(ReviewByUserGroups reviewByUserGroups)
      Defines the sub-steps in which the line items are reviewed by user groups, and whether these sub-steps run in sequence or in parallel.

      This setting is required: a review step without sub-steps fails validation when the Creation Workflow runs. Create the argument with api.newReviewByUserGroups(). Calling this method again replaces the previous value.

      Example:

      
       def reviewStep = api.newReviewStep()
           .withLabel("Review")
           .withReviewByUserGroupWithSubSteps(
               api.newReviewByUserGroups()
                   .withSequentialSubSteps(
                       api.newReviewSubStep()
                           .withUserGroup("SupplyCoordinator")
                           .withLabel("Supply Coordinator"),
                       api.newReviewSubStep()
                           .withUserGroup("PricingAdvisor")
                           .withLabel("Pricing Advisor")
                   )
           )
       
      Parameters:
      reviewByUserGroups - the review configuration
      Returns:
      The same ReviewStepDefinition object, for chaining.
      Since:
      14.0 - Caribou Lou
      See Also:
    • getLineItemFilters

      public Map<String,Filter> getLineItemFilters()
      Retrieves the line item filters defined on the review step level.

      Example:

      
       def filters = reviewStep.getLineItemFilters()  // [BusinessUnitPrinting: ..., ...]
       
      Returns:
      A map of user group unique names to their line item filters, or null if withLineItemFilters(Map) was not called.
      Since:
      14.0 - Caribou Lou
      See Also:
    • withLineItemFilters

      public ReviewStepDefinition withLineItemFilters(Map<String,Filter> lineItemFilters)
      Defines line items groups for this review step using filters. The line item groups are mapped to user groups. Each line item should be included in at most one line item group.

      Each key must be the unique name of an existing user group; otherwise the Creation Workflow execution fails. The line item groups decide which line items each user group sees for review, while the review sub-steps decide who reviews them and in which order, so use different user groups for the two.

      Define the filters either here, for the whole review step, or on the review sub-steps, not in both places. If you do not define them here, the sub-steps that start the review must define their own filters: each parallel sub-step, and the first sub-step of each sequence (or, if that first sub-step is a parallel group, each of its branches). The later sub-steps of a sequence must not define any filters; they use the filters of the first one.

      Example:

      
       def reviewStep = api.newReviewStep()
           .withLabel("Review")
           .withLineItemFilters([
               "BusinessUnitPrinting"   : Filter.like("inputs.BusinessUnit.value", "Printing"),
               "BusinessUnitResidential": Filter.like("inputs.BusinessUnit.value", "Residential and Small Business")
           ])
       
      Parameters:
      lineItemFilters - a map of user group unique names to their corresponding line item filters
      Returns:
      The same ReviewStepDefinition object, for chaining.
      Since:
      14.0 - Caribou Lou
      See Also:
    • getReviewByUserGroupWithSubSteps

      public ReviewByUserGroups getReviewByUserGroupWithSubSteps()
      Retrieves the review sub-step configuration of this review step.

      Example:

      
       def subSteps = reviewStep.getReviewByUserGroupWithSubSteps()
       
      Returns:
      The ReviewByUserGroups object set by withReviewByUserGroupWithSubSteps(ReviewByUserGroups), or null if it was not set.
      Since:
      14.0 - Caribou Lou
      See Also: