Package net.pricefx.common.dto
Class WorkflowDTO.ApprovalStepDTO
- Object
-
- WorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
-
- ApprovalStepDTO
-
- Enclosing class:
- WorkflowDTO
public static class WorkflowDTO.ApprovalStepDTO extends WorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
-
-
Field Summary
-
Fields inherited from class WorkflowDTO.StepDTO
alreadySatisfiedComment, emailAttachment, emailAttachmentTemplateName, properties, uniqueName, workflow
-
-
Constructor Summary
Constructors Constructor Description ApprovalStepDTO(WorkflowDTO workflow, String uniqueName)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description WorkflowDTO.ApprovalStepDTOaddProperty(String name, Object value)voidfromMap(Map<String,Object> values)List<Object>getApprovalRequiredEmailAttachments()StringgetApprover()Deprecated.Return the current approver in case of single approver set (or null if none set or if group approval)List<String>getApprovers()Return the current approvers (or null if none set or if group approval)List<String>getDenialReasons()BooleangetExcludeSubmitter()Returns status if the submitter is excluded in case of group approvalList<String>getMandatoryComments()List<Integer>getMinApprovalsForGroups()IntegergetMinApprovalsNeeded()List<String>getNotificationOnlyToUsers()Returns the subset of approvers that should recieve email notification.StringgetPostStepLogicName()StringgetReason()Deprecated.List<String>getReasons()Returns the reasons textStringgetUserGroupApprover()Deprecated.Gets user group name in case of single group approval (or null otherwise)List<String>getUserGroupApprovers()Gets user group names in case of group approval (or null otherwise)booleanisDenialReasonOptional()BooleanisMultiApprovalAllowed()WorkflowDTO.ApprovalStepDTOsetReason(String reason)Deprecated.Map<String,Object>toMap()WorkflowDTO.ApprovalStepDTOwithApprovalRequiredEmailAttachment(Object attachment)WorkflowDTO.ApprovalStepDTOwithApprovalRequiredEmailAttachments(Object attachments)WorkflowDTO.ApprovalStepDTOwithApprover(String userLoginName)Deprecated.Last invoked of#withApprover(String),#withUserGroupApprover(String)winsWorkflowDTO.ApprovalStepDTOwithApprovers(String... userLoginNames)Last invoked of#withApprovers(String...),#withUserGroupApprovers(String...)winsWorkflowDTO.ApprovalStepDTOwithDenialReasons(List<String> denialReasons, boolean isDenialReasonOptional)WorkflowDTO.ApprovalStepDTOwithExcludeSubmitter(boolean excludeSubmitter)Set exclude submitterWorkflowDTO.ApprovalStepDTOwithMandatoryComments(String... actions)Makes comment mandatory for certain actions.WorkflowDTO.ApprovalStepDTOwithMinApprovalsForGroups(Integer... minApprovalsForGroups)A minimum number of approvals needed for each group, to consider this step as approved.WorkflowDTO.ApprovalStepDTOwithMinApprovalsNeeded(int minApprovalsNeeded)A minimum number of approvals needed to consider this step as approved.WorkflowDTO.ApprovalStepDTOwithMultipleApprovalByGroupsAllowed(boolean multipleApprovalByGroupsAllowed)Deprecated.WorkflowDTO.ApprovalStepDTOwithNotificationOnlyToUsers(String... userLoginNames)Subset of approvers that should receive the email notificationWorkflowDTO.ApprovalStepDTOwithPostStepLogic(String logicUniqueName)Sets post step logic name that should be run after this step is executed (i.e.WorkflowDTO.ApprovalStepDTOwithReasons(String... reasons)Sets explanations for the approval step.WorkflowDTO.ApprovalStepDTOwithSingleUserMultiApprovalAllowed(boolean multiApprovalAllowed)WorkflowDTO.ApprovalStepDTOwithUserGroupApprover(String userGroupUniqueName)Deprecated.Last invoked of#withApprover(String),#withUserGroupApprover(LString)winsWorkflowDTO.ApprovalStepDTOwithUserGroupApprover(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)winsWorkflowDTO.ApprovalStepDTOwithUserGroupApprovers(String... userGroupUniqueNames)Last invoked of#withApprovers(String...),#withUserGroupApprovers(String...)wins-
Methods inherited from class WorkflowDTO.StepDTO
equals, getAlreadySatisfiedComment, getEmailAttachment, getEmailAttachmentTemplateName, getProperties, getUniqueName, hashCode, readSingleValue, withAlreadySatisfied, withAlreadySatisfied, withEmailAttachment, withEmailAttachment, withEmailAttachmentTemplateName
-
-
-
-
Constructor Detail
-
ApprovalStepDTO
public ApprovalStepDTO(WorkflowDTO workflow, String uniqueName)
-
-
Method Detail
-
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 for the approval step- Parameters:
reason- The reason- Returns:
-
withReasons
public WorkflowDTO.ApprovalStepDTO withReasons(String... reasons)
Sets explanations for 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 r1 corresponds to a1, r2 to a2 etc. If you want to put multiple reasons to a single approver, you need to join the strings and return a single combined reason in the code.- Returns:
-
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
-
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 isWorkflowDTO#withDefaultPostApprovalStepLogic(String)set
-
getPostStepLogicName
public String getPostStepLogicName()
-
toMap
public Map<String,Object> toMap()
- Overrides:
toMapin classWorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
-
fromMap
public void fromMap(Map<String,Object> values)
- Overrides:
fromMapin classWorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
-
withDenialReasons
public WorkflowDTO.ApprovalStepDTO withDenialReasons(List<String> denialReasons, boolean isDenialReasonOptional)
-
isDenialReasonOptional
public boolean isDenialReasonOptional()
-
getMinApprovalsNeeded
public Integer getMinApprovalsNeeded()
-
isMultiApprovalAllowed
public Boolean isMultiApprovalAllowed()
-
withMultipleApprovalByGroupsAllowed
@Deprecated public WorkflowDTO.ApprovalStepDTO withMultipleApprovalByGroupsAllowed(boolean multipleApprovalByGroupsAllowed)
Deprecated.
-
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.
-
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:
-
-