Class WorkflowDTO.ApprovalStepDTO

    • Constructor Detail

      • ApprovalStepDTO

        public ApprovalStepDTO​(WorkflowDTO workflow,
                               String uniqueName)
    • Method Detail

      • 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
      • 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
      • 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.
      • 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()
      • getApprovalRequiredEmailAttachments

        public List<Object> getApprovalRequiredEmailAttachments()
      • getDenialReasons

        public List<String> getDenialReasons()
      • isDenialReasonOptional

        public boolean isDenialReasonOptional()
      • getMinApprovalsNeeded

        public Integer getMinApprovalsNeeded()
      • getMinApprovalsForGroups

        public List<Integer> getMinApprovalsForGroups()
      • isMultiApprovalAllowed

        public Boolean isMultiApprovalAllowed()
      • isParallelStepApprovalAllowed

        public Boolean isParallelStepApprovalAllowed()
      • getMandatoryComments

        public List<String> getMandatoryComments()
      • withSingleUserMultiApprovalAllowed

        public WorkflowDTO.ApprovalStepDTO withSingleUserMultiApprovalAllowed​(boolean multiApprovalAllowed)
        Parameters:
        multiApprovalAllowed - When true, then an approver can approve not only once, but that many times as he has number of groups that are allowed to approve.
      • withParallelStepApprovalAllowed

        public WorkflowDTO.ApprovalStepDTO withParallelStepApprovalAllowed​(boolean parallelStepApprovalAllowed)
        Parameters:
        parallelStepApprovalAllowed - When true, multiApprovalAllowed enabled, the approver will by single approve trigger approve all all parallel steps that he is entitled to.
      • 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: