Class WorkflowDTO


  • public class WorkflowDTO
    extends Object
    This class is basically the type that is exposed by the workflow formula binding workflow
    So in your workflow formula you would call methods on that instance to add approval nodes and/or watcher nodes and supply further details while doing so.
    The methods are designed to be used in a simple flow pattern.
    Simple example:
     workflow.addApprovalStep("First Approval").withApprover("admin").setReason("Admin needs always approve")
     
    • Constructor Detail

      • WorkflowDTO

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

        public WorkflowDTO​(WorkflowType type,
                           String typedId)
    • Method Detail

      • addApprovalStep

        public WorkflowDTO.ApprovalStepDTO addApprovalStep​(String uniqueName)
        Adds an approval step at the end of the workflow
        Parameters:
        uniqueName - Name of the step
        Returns:
      • addWatcherStep

        public WorkflowDTO.WatcherStepDTO addWatcherStep​(String uniqueName)
        Adds a watcher step to the end of the workflow. A watcher step cannot approve or deny, but will receive a notification when it becomes active
        Parameters:
        uniqueName - Name of the step
        Returns:
      • getType

        public WorkflowType getType()
        Returns the type of the workflow. Corresponds to the underlying approvable.
        QUOTE("quote"), PRICEGRIDITEM("pricegriditem"), REBATEAGREEMENT("rebateagreement"), CONTRACT("contract"), DATACHANGEREQUEST("dcr"), PRICELIST("pricelist"), REBATERECORD("rebaterecord");
        Returns:
      • removeStep

        public boolean removeStep​(String uniqueName)
        Removes a named step (if existing)
        Parameters:
        uniqueName - The name of the step
        Returns:
      • getStep

        public WorkflowDTO.StepDTO getStep​(String uniqueName)
        Retrieves a named step (if existing)
        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)
      • withDenialReasons

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

        public List<String> getDenialReasons()
      • isDenialReasonOptional

        public boolean isDenialReasonOptional()
      • getTypedId

        public String getTypedId()
      • withAddStepRestrictedToWFAdmin

        public WorkflowDTO withAddStepRestrictedToWFAdmin()
      • withAddStepRestrictedToWFAdmin

        public WorkflowDTO withAddStepRestrictedToWFAdmin​(boolean isAddStepRestrictedToWFAdmin)
      • isAddStepRestrictedToWFAdmin

        public boolean isAddStepRestrictedToWFAdmin()
      • withSelectStepOnDeny

        public WorkflowDTO withSelectStepOnDeny​(boolean isSelectStepOnDeny)
      • isSelectStepOnDeny

        public boolean isSelectStepOnDeny()
      • 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()
      • withRunDefaultPostApprovalStepLogicOnEmptyWorkflow

        public WorkflowDTO withRunDefaultPostApprovalStepLogicOnEmptyWorkflow​(boolean runDefaultPostStepLogicOnEmptyWorkflow)
        Decides if default post step logic should be executed also in case the wf is empty (has no 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