Package net.pricefx.common.dto
Class WorkflowDTO.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
-
Method Summary
Modifier and TypeMethodDescriptionaddProperty
(String name, Object value) void
Deprecated.Return the current approver in case of single approver set (or null if none set or if group approval)Return the current approvers (or null if none set or if group approval)Returns all denial reasons defined for this approval stepReturns status if the submitter is excluded in case of group approvalReturns mandatory comments for this approval stepReturns the minimum number of approvers needed for each user group in this step.Returns the minimum number of approvers needed for this approval stepReturns the subset of approvers that should recieve email notification.Deprecated.Returns the reasons textDeprecated.Gets user group name in case of single group approval (or null otherwise)Gets user group names in case of group approval (or null otherwise)boolean
Returns whether the denial reasons are optional in this approval step.Enables the user to approve the same approval step several times if that step requires multiple approvers.Enables the users can approve all parallel steps at onceDeprecated.toMap()
withApprovalRequiredEmailAttachment
(Object attachment) withApprovalRequiredEmailAttachments
(Object attachments) withApprover
(String userLoginName) Deprecated.Last invoked of#withApprover(String)
,#withUserGroupApprover(String)
winswithApprovers
(String... userLoginNames) Last invoked of#withApprovers(String...)
,#withUserGroupApprovers(String...)
winswithConditionRecordLogic
(String logicUniqueName) Sets condition record logic name that should be run after final step is executed (i.e.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.withExcludeSubmitter
(boolean excludeSubmitter) Set exclude submitterwithMandatoryComments
(String... actions) Makes comment mandatory for certain actions.withMinApprovalsForGroups
(Integer... minApprovalsForGroups) A minimum number of approvals needed for each group, to consider this step as approved.withMinApprovalsNeeded
(int minApprovalsNeeded) A minimum number of approvals needed to consider this step as approved.withMultipleApprovalByGroupsAllowed
(boolean multipleApprovalByGroupsAllowed) Deprecated.withNotificationOnlyToUsers
(String... userLoginNames) Subset of approvers that should receive the email notificationwithParallelStepApprovalAllowed
(boolean parallelStepApprovalAllowed) withPostStepLogic
(String logicUniqueName) Sets post step logic name that should be run after this step is executed (i.e.withReasons
(String... reasons) Sets explanation reasons for approvers of the approval step.withSingleUserMultiApprovalAllowed
(boolean multiApprovalAllowed) withUserGroupApprover
(String userGroupUniqueName) Deprecated.Last invoked of#withApprover(String)
,#withUserGroupApprover(LString)
winswithUserGroupApprover
(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)
winswithUserGroupApprovers
(String... userGroupUniqueNames) Last invoked of#withApprovers(String...)
,#withUserGroupApprovers(String...)
winsMethods inherited from class WorkflowDTO.StepDTO
equals, getAlreadySatisfiedComment, getEmailAttachment, getEmailAttachmentTemplateName, getProperties, getUniqueName, hashCode, readSingleValue, withAlreadySatisfied, withAlreadySatisfied, withEmailAttachment, withEmailAttachment, withEmailAttachmentTemplateName
-
Constructor Details
-
ApprovalStepDTO
-
-
Method Details
-
withApprover
Deprecated.Last invoked of#withApprover(String)
,#withUserGroupApprover(String)
wins -
withApprovers
Last invoked of#withApprovers(String...)
,#withUserGroupApprovers(String...)
wins -
withNotificationOnlyToUsers
Subset of approvers that should receive the email notification -
withUserGroupApprover
Deprecated.Last invoked of#withApprover(String)
,#withUserGroupApprover(LString)
wins -
withUserGroupApprovers
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
Set exclude submitter -
setReason
Deprecated.Set an explanation reason for the approval step.- Parameters:
reason
- The reason- Returns:
-
withReasons
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
-
withApprovalRequiredEmailAttachment
-
withApprovalRequiredEmailAttachments
-
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
Return the current approvers (or null if none set or if group approval)- Returns:
- The user names
-
getNotificationOnlyToUsers
Returns the subset of approvers that should recieve email notification.- Returns:
- The user names
-
getReason
Deprecated.Returns the reason text- Returns:
- The reason
-
getReasons
Returns the reasons text- Returns:
- The reasons
-
getExcludeSubmitter
Returns status if the submitter is excluded in case of group approval- Returns:
- true if excluded
-
getUserGroupApprover
Deprecated.Gets user group name in case of single group approval (or null otherwise)- Returns:
-
getUserGroupApprovers
Gets user group names in case of group approval (or null otherwise)- Returns:
-
withMinApprovalsNeeded
A minimum number of approvals needed to consider this step as approved. Default is 1- Parameters:
minApprovalsNeeded
-- Returns:
-
withMinApprovalsForGroups
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
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
-
withConditionRecordLogic
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:
Supported object types:workflow.addApprovalStep("DefaultApproval") .withApprovers("user1") .withConditionRecordLogic("") .setReason("Standard approval")
- 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 isWorkflowDTO#withDefaultConditionRecordLogic(String)
set.- Returns:
- The updated ApprovalStepDTO instance with the specified condition record logic.
- Since:
- 13.0 - Rampur
- See Also:
-
getConditionRecordLogicName
-
getApprovalRequiredEmailAttachments
-
toMap
- Overrides:
toMap
in classWorkflowDTO.StepDTO<WorkflowDTO.ApprovalStepDTO>
-
fromMap
- Overrides:
fromMap
in classWorkflowDTO.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 reasonsisDenialReasonOptional
- False, if the denial reasons should be mandatory- Returns:
- The approval step itself.
-
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
Returns the minimum number of approvers needed for this approval step -
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
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
Enables the users can approve all parallel steps at once -
getMandatoryComments
Returns mandatory comments for this approval step -
withMultipleApprovalByGroupsAllowed
@Deprecated public WorkflowDTO.ApprovalStepDTO withMultipleApprovalByGroupsAllowed(boolean multipleApprovalByGroupsAllowed) Deprecated. -
withSingleUserMultiApprovalAllowed
- 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
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:
-