Class WorkflowDTO

Object
WorkflowDTO

public class WorkflowDTO extends Object
This class is basically the type of object, which is exposed in the workflow logic by the binding variable workflow

In your workflow logic you would call methods on that class instance to add approval nodes and/or watcher nodes and supply further details

The methods are designed to be used in a simple flow pattern.

Simple example:


 workflow.addApprovalStep("First Approval").withApprovers("admin").withReasons("Admin needs always approve")
 
  • Constructor Details

    • WorkflowDTO

      public WorkflowDTO(WorkflowType type, String typedId, String submitReason, boolean isMassUpdate)
    • WorkflowDTO

      public WorkflowDTO(WorkflowType type, String typedId)
  • Method Details

    • addApprovalStep

      public WorkflowDTO.ApprovalStepDTO addApprovalStep(String uniqueName)
      Adds a new approval step at the end of the approval workflow.
      Parameters:
      uniqueName - Name of the step, it must be unique inside one approval workflow. If you will add again a Step with the same unique name, you will override the existing one.
      Returns:
      The Approval Step itself.
    • addWatcherStep

      public WorkflowDTO.WatcherStepDTO addWatcherStep(String uniqueName)
      Adds a watcher step to the end of the approval workflow. A watcher step cannot approve or deny, but will receive a notification when it becomes active.
      Parameters:
      uniqueName - Name of the step. It must be unique inside one approval flow. If you will add again a Step with the same unique name, you will override the existing one.
      Returns:
      The Watcher Step itself.
    • getType

      public WorkflowType getType()
      Returns the type of the workflow. Corresponds to the underlying approvable document:
      • QUOTE("quote")
      • PRICEGRIDITEM("pricegriditem")
      • REBATEAGREEMENT("rebateagreement")
      • CONTRACT("contract")
      • DATACHANGEREQUEST("dcr")
      • PRICELIST("pricelist")
      • REBATERECORD("rebaterecord")
      • MODELRECORD("modelrecord")
      • CLAIM("claim")
      Returns:
      The Type of the Workflow.
    • removeStep

      public boolean removeStep(String uniqueName)
      Removes a workflow step with given unique name (if it exists).
      Parameters:
      uniqueName - The name of the step
      Returns:
    • getStep

      public WorkflowDTO.StepDTO getStep(String uniqueName)
      Retrieves a workflow step with given name (if it exists)
      Parameters:
      uniqueName - The name of the step
      Returns:
    • getSubmitReason

      public String getSubmitReason()
      Gets reason entered by submitter
      Returns:
    • setSubmitReason

      public void setSubmitReason(String submitReason)
      Overrides reason entered by submitter
      Parameters:
      submitReason -
    • addItemReason

      public void addItemReason(String itemTypedId, String reason)
    • getItemReasons

      public Map<String,String> getItemReasons()
    • withDenialReasons

      public WorkflowDTO withDenialReasons(List<String> denialReasons, boolean isDenialReasonOptional)
    • getDenialReasons

      public List<String> getDenialReasons()
    • isDenialReasonOptional

      public boolean isDenialReasonOptional()
    • getTypedId

      public String getTypedId()
    • getSteps

      public LinkedHashSet<WorkflowDTO.StepDTO> getSteps()
    • withAddStepRestrictedToWFAdmin

      public WorkflowDTO withAddStepRestrictedToWFAdmin()
    • withAddStepRestrictedToWFAdmin

      public WorkflowDTO withAddStepRestrictedToWFAdmin(boolean isAddStepRestrictedToWFAdmin)
    • isAddStepRestrictedToWFAdmin

      public boolean isAddStepRestrictedToWFAdmin()
    • withSelectStepOnDeny

      public WorkflowDTO withSelectStepOnDeny(boolean isSelectStepOnDeny)
    • isSelectStepOnDeny

      public boolean isSelectStepOnDeny()
    • getDataMap

      public Map<String,Object> getDataMap()
    • withDataMap

      public WorkflowDTO withDataMap(Map<String,Object> dataMap)
      Sets dataMap map, which is available then in email templates
      Parameters:
      dataMap - The map with additional data needed to render the template.
      Returns:
    • withDefaultPostApprovalStepLogic

      public WorkflowDTO withDefaultPostApprovalStepLogic(String postApprovalStepLogicUniqueName)
      Adds a logic that will be executed after every approval step.
      Parameters:
      postApprovalStepLogicUniqueName - Unique name of wf post step logic
    • getDefaultPostApprovalStepLogicName

      public String getDefaultPostApprovalStepLogicName()
    • withDefaultConditionRecordLogic

      public WorkflowDTO withDefaultConditionRecordLogic(String conditionRecordLogicName)
      Adds a logic that will be executed after the final approval step or after each approved contract recalculation.

      Example – Condition Record logic defined as a part of the Workflow Logic definition:

      
       workflow.withDefaultConditionRecordLogic("DefaultCRLogic")
       
      Supported object types:
      • quote
      • pricegriditem
      • calculationgriditem
      • rebateagreement
      • contract
      • dcr
      • pricelist
      • rebaterecord
      • modelrecord
      • claim
      • dealplan
      • model
      • customform
      • compensation
      • compensationrecord
      • rebaterecordgroup
      Parameters:
      conditionRecordLogicName - Unique name of the condition record logic to be executed.
      Returns:
      The updated WorkflowDTO instance with the specified condition record logic.
      Since:
      13.0 - Rampur
      See Also:
    • getDefaultConditionRecordLogicName

      public String getDefaultConditionRecordLogicName()
    • withRunDefaultPostApprovalStepLogicOnEmptyWorkflow

      public WorkflowDTO withRunDefaultPostApprovalStepLogicOnEmptyWorkflow(boolean runDefaultPostStepLogicOnEmptyWorkflow)
      Decides if default post step logic should be executed also in case the wf has no approval steps (i.e. empty or all steps are watcher steps).
      Parameters:
      runDefaultPostStepLogicOnEmptyWorkflow - Default is false.
    • getRunDefaultPostApprovalStepLogicOnEmptyWorkflow

      public boolean getRunDefaultPostApprovalStepLogicOnEmptyWorkflow()
    • withAutoConvertToDeal

      public WorkflowDTO withAutoConvertToDeal(boolean autoConvertToDeal)
      If true then automatically converts quote to deal when quote is approved
      Parameters:
      autoConvertToDeal - flag if should be automatically converted
    • isAutoConvertToDeal

      public Boolean isAutoConvertToDeal()
    • isMassUpdate

      public boolean isMassUpdate()
      Returns:
      true If workflow is called from mass update job