Class WorkflowDTO.ApprovalStepDTO

Enclosing class:
WorkflowDTO

public static class WorkflowDTO.ApprovalStepDTO extends WorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
  • Constructor Details

  • Method Details

    • withApprover

      @Deprecated public WorkflowDTO.ApprovalStepDTO withApprover(String userLoginName)
      Deprecated.
      Last invoked of #withApprover(String), #withUserGroupApprover(String) wins
    • withApprovers

      public WorkflowDTO.ApprovalStepDTO withApprovers(String... userLoginNames)
      Last invoked of #withApprovers(String...), #withUserGroupApprovers(String...) wins
    • withNotificationOnlyToUsers

      public WorkflowDTO.ApprovalStepDTO withNotificationOnlyToUsers(String... userLoginNames)
      Subset of approvers that should receive the email notification
    • withUserGroupApprover

      @Deprecated public WorkflowDTO.ApprovalStepDTO withUserGroupApprover(String userGroupUniqueName)
      Deprecated.
      Last invoked of #withApprover(String), #withUserGroupApprover(LString) wins
    • withUserGroupApprovers

      public WorkflowDTO.ApprovalStepDTO withUserGroupApprovers(String... userGroupUniqueNames)
      Last invoked of #withApprovers(String...), #withUserGroupApprovers(String...) wins
    • withUserGroupApprover

      @Deprecated public WorkflowDTO.ApprovalStepDTO withUserGroupApprover(String userGroupUniqueName, boolean excludeSubmitter)
      Deprecated.
      Same as #withUserGroupApprover(String) but the submitter is excluded in case he is memeber of the group Last invoked of #withApprover(String), #withUserGroupApprover(String) wins
    • withExcludeSubmitter

      public WorkflowDTO.ApprovalStepDTO withExcludeSubmitter(boolean excludeSubmitter)
      Set exclude submitter
    • setReason

      @Deprecated public WorkflowDTO.ApprovalStepDTO setReason(String reason)
      Deprecated.
      Set an explanation reason for the approval step.
      Parameters:
      reason - The reason
      Returns:
    • withReasons

      public WorkflowDTO.ApprovalStepDTO withReasons(String... reasons)
      Sets explanation reasons for approvers of the approval step.
      Parameters:
      reasons - The reasons why each approver needs to approve. The reasons match approvers, e.g. if you have 3 approvers (A1, A2, A3), you can specify up to 3 reasons (R1, R2, R3) and then reason R1 applies to approver A1, reason R2 applies to approver A2, etc. If you want to put multiple reasons to a single approver, you need to join the reason messages together into one string and provide such single combined reason for the approver.
      Returns:
      The approval step itself.
    • addProperty

      public WorkflowDTO.ApprovalStepDTO addProperty(String name, Object value)
    • withApprovalRequiredEmailAttachment

      public WorkflowDTO.ApprovalStepDTO withApprovalRequiredEmailAttachment(Object attachment)
    • withApprovalRequiredEmailAttachments

      public WorkflowDTO.ApprovalStepDTO withApprovalRequiredEmailAttachments(Object attachments)
    • getApprover

      @Deprecated public String getApprover()
      Deprecated.
      Return the current approver in case of single approver set (or null if none set or if group approval)
      Returns:
      The user name
    • getApprovers

      public List<String> getApprovers()
      Return the current approvers (or null if none set or if group approval)
      Returns:
      The user names
    • getNotificationOnlyToUsers

      public List<String> getNotificationOnlyToUsers()
      Returns the subset of approvers that should recieve email notification.
      Returns:
      The user names
    • getReason

      @Deprecated public String getReason()
      Deprecated.
      Returns the reason text
      Returns:
      The reason
    • getReasons

      public List<String> getReasons()
      Returns the reasons text
      Returns:
      The reasons
    • getExcludeSubmitter

      public Boolean getExcludeSubmitter()
      Returns status if the submitter is excluded in case of group approval
      Returns:
      true if excluded
    • getUserGroupApprover

      @Deprecated public String getUserGroupApprover()
      Deprecated.
      Gets user group name in case of single group approval (or null otherwise)
      Returns:
    • getUserGroupApprovers

      public List<String> getUserGroupApprovers()
      Gets user group names in case of group approval (or null otherwise)
      Returns:
    • withMinApprovalsNeeded

      public WorkflowDTO.ApprovalStepDTO withMinApprovalsNeeded(int minApprovalsNeeded)
      A minimum number of approvals needed to consider this step as approved. Default is 1
      Parameters:
      minApprovalsNeeded -
      Returns:
    • withMinApprovalsForGroups

      public WorkflowDTO.ApprovalStepDTO withMinApprovalsForGroups(Integer... minApprovalsForGroups)
      A minimum number of approvals needed for each group, to consider this step as approved. Default is 0 for each group.
      Parameters:
      minApprovalsForGroups - Resets minApprovalsNeeded
      Returns:
    • withPostStepLogic

      public WorkflowDTO.ApprovalStepDTO withPostStepLogic(String logicUniqueName)
      Sets post step logic name that should be run after this step is executed (i.e. Approved, Denied or Withdrawn)
      Parameters:
      logicUniqueName - Workflow Post Step Logic unique name. If null, WorkflowDTO#withDefaultPostApprovalStepLogic(String) will be used, if empty string, no logic will be used even if there is WorkflowDTO#withDefaultPostApprovalStepLogic(String) set
    • getPostStepLogicName

      public String getPostStepLogicName()
    • withConditionRecordLogic

      public WorkflowDTO.ApprovalStepDTO withConditionRecordLogic(String logicUniqueName)
      Sets condition record logic name that should be run after final step is executed (i.e. Approved or Denied) or after each approved contract recalculation.

      Example – Condition Record logic defined at the level of a specific step. This means that you can run specific CR logic on deny, approve, and different for certain WF steps:

      
       workflow.addApprovalStep("DefaultApproval")
                       .withApprovers("user1")
                       .withConditionRecordLogic("ApprovalCRLogic")
                       .setReason("Standard approval")
       

      Example – disabling the default Condition Record logic by defining null on the step:

      
       workflow.addApprovalStep("DefaultApproval")
                       .withApprovers("user1")
                       .withConditionRecordLogic("")
                       .setReason("Standard approval")
       
      Supported object types:
      • quote
      • pricegriditem
      • calculationgriditem
      • rebateagreement
      • contract
      • dcr
      • pricelist
      • rebaterecord
      • modelrecord
      • claim
      • dealplan
      • model
      • customform
      • compensation
      • compensationrecord
      • rebaterecordgroup
      Parameters:
      logicUniqueName - Condition Record Logic unique name. If null, WorkflowDTO#withDefaultConditionRecordLogic(String) will be used, if empty string, no logic will be used, even if there is WorkflowDTO#withDefaultConditionRecordLogic(String) set.
      Returns:
      The updated ApprovalStepDTO instance with the specified condition record logic.
      Since:
      13.0 - Rampur
      See Also:
    • getConditionRecordLogicName

      public String getConditionRecordLogicName()
    • getApprovalRequiredEmailAttachments

      public List<Object> getApprovalRequiredEmailAttachments()
    • toMap

      public Map<String,Object> toMap()
      Overrides:
      toMap in class WorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
    • fromMap

      public void fromMap(Map<String,Object> values)
      Overrides:
      fromMap in class WorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
    • withDenialReasons

      public WorkflowDTO.ApprovalStepDTO withDenialReasons(List<String> denialReasons, boolean isDenialReasonOptional)
      Denial Reasons is a list of predefined text options, which will be presented to the approver, while denying the item. The user would be able to either select one of them, or alternatively write free text reason. Providing the denial reasons can be optional or mandatory
      Parameters:
      denialReasons - Predefined workflow denial reasons
      isDenialReasonOptional - False, if the denial reasons should be mandatory
      Returns:
      The approval step itself.
    • getDenialReasons

      public List<String> getDenialReasons()
      Returns all denial reasons defined for this approval step
    • isDenialReasonOptional

      public boolean isDenialReasonOptional()
      Returns whether the denial reasons are optional in this approval step. If they're not optional, then they're mantatory
    • getMinApprovalsNeeded

      public Integer getMinApprovalsNeeded()
      Returns the minimum number of approvers needed for this approval step
    • getMinApprovalsForGroups

      public List<Integer> getMinApprovalsForGroups()
      Returns the minimum number of approvers needed for each user group in this step. The list is in the same order, in which is the list of Groups for this step
    • isMultiApprovalAllowed

      public Boolean isMultiApprovalAllowed()
      Enables the user to approve the same approval step several times if that step requires multiple approvers. User can approve that many times as he has number of groups that are allowed to approve
    • isParallelStepApprovalAllowed

      public Boolean isParallelStepApprovalAllowed()
      Enables the users can approve all parallel steps at once
    • getMandatoryComments

      public List<String> getMandatoryComments()
      Returns mandatory comments for this approval step
    • withMultipleApprovalByGroupsAllowed

      @Deprecated public WorkflowDTO.ApprovalStepDTO withMultipleApprovalByGroupsAllowed(boolean multipleApprovalByGroupsAllowed)
      Deprecated.
    • withSingleUserMultiApprovalAllowed

      public WorkflowDTO.ApprovalStepDTO withSingleUserMultiApprovalAllowed(boolean multiApprovalAllowed)
      Parameters:
      multiApprovalAllowed - When true, the user can approve the same step as many times as the group setting allows
    • withParallelStepApprovalAllowed

      public WorkflowDTO.ApprovalStepDTO withParallelStepApprovalAllowed(boolean parallelStepApprovalAllowed)
      Parameters:
      parallelStepApprovalAllowed - When set to true and the multiApprovalAllowed option is enabled, the approver approves all parallel steps that the group he is a member of allows.
    • withMandatoryComments

      public WorkflowDTO.ApprovalStepDTO withMandatoryComments(String... actions)
      Makes comment mandatory for certain actions.

      Example:

      workflow.addApprovalStep("ApproverWithDefault")
      	.withUserGroupApprovers("Group1", "Group2", "Group3")
      	.withMandatoryComments("DENY", "APPROVE")
      	.withMinApprovalsForGroups(1, 1, 2)
       

      Parameters:
      actions - for which comment is mandatory. This method accepts only values "APPROVE" and "DENY". Other values will be ignored.
      Returns: