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.ApprovalStepDTO
addProperty(String name, Object value)
void
fromMap(Map<String,Object> values)
List<Object>
getApprovalRequiredEmailAttachments()
String
getApprover()
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()
Boolean
getExcludeSubmitter()
Returns status if the submitter is excluded in case of group approvalList<String>
getMandatoryComments()
List<Integer>
getMinApprovalsForGroups()
Integer
getMinApprovalsNeeded()
List<String>
getNotificationOnlyToUsers()
Returns the subset of approvers that should recieve email notification.String
getPostStepLogicName()
String
getReason()
Deprecated.List<String>
getReasons()
Returns the reasons textString
getUserGroupApprover()
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)boolean
isDenialReasonOptional()
Boolean
isMultiApprovalAllowed()
Boolean
isParallelStepApprovalAllowed()
WorkflowDTO.ApprovalStepDTO
setReason(String reason)
Deprecated.Map<String,Object>
toMap()
WorkflowDTO.ApprovalStepDTO
withApprovalRequiredEmailAttachment(Object attachment)
WorkflowDTO.ApprovalStepDTO
withApprovalRequiredEmailAttachments(Object attachments)
WorkflowDTO.ApprovalStepDTO
withApprover(String userLoginName)
Deprecated.Last invoked of#withApprover(String)
,#withUserGroupApprover(String)
winsWorkflowDTO.ApprovalStepDTO
withApprovers(String... userLoginNames)
Last invoked of#withApprovers(String...)
,#withUserGroupApprovers(String...)
winsWorkflowDTO.ApprovalStepDTO
withDenialReasons(List<String> denialReasons, boolean isDenialReasonOptional)
WorkflowDTO.ApprovalStepDTO
withExcludeSubmitter(boolean excludeSubmitter)
Set exclude submitterWorkflowDTO.ApprovalStepDTO
withMandatoryComments(String... actions)
Makes comment mandatory for certain actions.WorkflowDTO.ApprovalStepDTO
withMinApprovalsForGroups(Integer... minApprovalsForGroups)
A minimum number of approvals needed for each group, to consider this step as approved.WorkflowDTO.ApprovalStepDTO
withMinApprovalsNeeded(int minApprovalsNeeded)
A minimum number of approvals needed to consider this step as approved.WorkflowDTO.ApprovalStepDTO
withMultipleApprovalByGroupsAllowed(boolean multipleApprovalByGroupsAllowed)
Deprecated.WorkflowDTO.ApprovalStepDTO
withNotificationOnlyToUsers(String... userLoginNames)
Subset of approvers that should receive the email notificationWorkflowDTO.ApprovalStepDTO
withParallelStepApprovalAllowed(boolean parallelStepApprovalAllowed)
WorkflowDTO.ApprovalStepDTO
withPostStepLogic(String logicUniqueName)
Sets post step logic name that should be run after this step is executed (i.e.WorkflowDTO.ApprovalStepDTO
withReasons(String... reasons)
Sets explanation reasons for approvers of the approval step.WorkflowDTO.ApprovalStepDTO
withSingleUserMultiApprovalAllowed(boolean multiApprovalAllowed)
WorkflowDTO.ApprovalStepDTO
withUserGroupApprover(String userGroupUniqueName)
Deprecated.Last invoked of#withApprover(String)
,#withUserGroupApprover(LString)
winsWorkflowDTO.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)
winsWorkflowDTO.ApprovalStepDTO
withUserGroupApprovers(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 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
-
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:
toMap
in classWorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
-
fromMap
public void fromMap(Map<String,Object> values)
- Overrides:
fromMap
in 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()
-
isParallelStepApprovalAllowed
public Boolean isParallelStepApprovalAllowed()
-
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.
-
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:
-
-