Class 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 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 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)
      • 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