Package net.pricefx.common.dto
Class WorkflowDTO
Object
WorkflowDTO
This class is basically the type of object, which is exposed in the workflow logic by
the binding variable
workflow
In your workflow logic you would call methods on that class instance to add approval nodes and/or watcher nodes and supply further details
The methods are designed to be used in a simple flow pattern.
Simple example:
workflow.addApprovalStep("First Approval").withApprovers("admin").withReasons("Admin needs always approve")
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
WorkflowDTO.StepDTO<T extends WorkflowDTO.StepDTO>
static class
-
Constructor Summary
ConstructorDescriptionWorkflowDTO
(WorkflowType type, String typedId) WorkflowDTO
(WorkflowType type, String typedId, String submitReason, boolean isMassUpdate) -
Method Summary
Modifier and TypeMethodDescriptionaddApprovalStep
(String uniqueName) Adds a new approval step at the end of the approval workflow.void
addItemReason
(String itemTypedId, String reason) addWatcherStep
(String uniqueName) Adds a watcher step to the end of the approval workflow.boolean
Retrieves a workflow step with given name (if it exists)getSteps()
Gets reason entered by submitterWorkflowType
getType()
Returns the type of the workflow.boolean
boolean
boolean
boolean
boolean
removeStep
(String uniqueName) Removes a workflow step with given unique name (if it exists).void
setSubmitReason
(String submitReason) Overrides reason entered by submitterwithAddStepRestrictedToWFAdmin
(boolean isAddStepRestrictedToWFAdmin) withAutoConvertToDeal
(boolean autoConvertToDeal) Iftrue
then automatically converts quote to deal when quote is approvedwithDataMap
(Map<String, Object> dataMap) Sets dataMap map, which is available then in email templateswithDefaultConditionRecordLogic
(String conditionRecordLogicName) Adds a logic that will be executed after the final approval step or after each approved contract recalculation.withDefaultPostApprovalStepLogic
(String postApprovalStepLogicUniqueName) Adds a logic that will be executed after every approval step.withDenialReasons
(List<String> denialReasons, boolean isDenialReasonOptional) withRunDefaultPostApprovalStepLogicOnEmptyWorkflow
(boolean runDefaultPostStepLogicOnEmptyWorkflow) Decides if default post step logic should be executed also in case the wf has no approval steps (i.e. empty or all steps are watcher steps).withSelectStepOnDeny
(boolean isSelectStepOnDeny)
-
Constructor Details
-
WorkflowDTO
-
WorkflowDTO
-
-
Method Details
-
addApprovalStep
Adds a new approval step at the end of the approval workflow.- Parameters:
uniqueName
- Name of the step, it must be unique inside one approval workflow. If you will add again a Step with the same unique name, you will override the existing one.- Returns:
- The Approval Step itself.
-
addWatcherStep
Adds a watcher step to the end of the approval workflow. A watcher step cannot approve or deny, but will receive a notification when it becomes active.- Parameters:
uniqueName
- Name of the step. It must be unique inside one approval flow. If you will add again a Step with the same unique name, you will override the existing one.- Returns:
- The Watcher Step itself.
-
getType
public WorkflowType getType()Returns the type of the workflow. Corresponds to the underlying approvable document:- QUOTE("quote")
- PRICEGRIDITEM("pricegriditem")
- REBATEAGREEMENT("rebateagreement")
- CONTRACT("contract")
- DATACHANGEREQUEST("dcr")
- PRICELIST("pricelist")
- REBATERECORD("rebaterecord")
- MODELRECORD("modelrecord")
- CLAIM("claim")
- Returns:
- The Type of the Workflow.
-
removeStep
Removes a workflow step with given unique name (if it exists).- Parameters:
uniqueName
- The name of the step- Returns:
-
getStep
Retrieves a workflow step with given name (if it exists)- Parameters:
uniqueName
- The name of the step- Returns:
-
getSubmitReason
Gets reason entered by submitter- Returns:
-
setSubmitReason
Overrides reason entered by submitter- Parameters:
submitReason
-
-
addItemReason
-
getItemReasons
-
withDenialReasons
-
getDenialReasons
-
isDenialReasonOptional
public boolean isDenialReasonOptional() -
getTypedId
-
getSteps
-
withAddStepRestrictedToWFAdmin
-
withAddStepRestrictedToWFAdmin
-
isAddStepRestrictedToWFAdmin
public boolean isAddStepRestrictedToWFAdmin() -
withSelectStepOnDeny
-
isSelectStepOnDeny
public boolean isSelectStepOnDeny() -
getDataMap
-
withDataMap
Sets dataMap map, which is available then in email templates- Parameters:
dataMap
- The map with additional data needed to render the template.- Returns:
-
withDefaultPostApprovalStepLogic
Adds a logic that will be executed after every approval step.- Parameters:
postApprovalStepLogicUniqueName
- Unique name of wf post step logic
-
getDefaultPostApprovalStepLogicName
-
withDefaultConditionRecordLogic
Adds a logic that will be executed after the final approval step or after each approved contract recalculation.Example – Condition Record logic defined as a part of the Workflow Logic definition:
Supported object types:workflow.withDefaultConditionRecordLogic("DefaultCRLogic")
- quote
- pricegriditem
- calculationgriditem
- rebateagreement
- contract
- dcr
- pricelist
- rebaterecord
- modelrecord
- claim
- dealplan
- model
- customform
- compensation
- compensationrecord
- rebaterecordgroup
- Parameters:
conditionRecordLogicName
- Unique name of the condition record logic to be executed.- Returns:
- The updated WorkflowDTO instance with the specified condition record logic.
- Since:
- 13.0 - Rampur
- See Also:
-
getDefaultConditionRecordLogicName
-
withRunDefaultPostApprovalStepLogicOnEmptyWorkflow
public WorkflowDTO withRunDefaultPostApprovalStepLogicOnEmptyWorkflow(boolean runDefaultPostStepLogicOnEmptyWorkflow) Decides if default post step logic should be executed also in case the wf has no approval steps (i.e. empty or all steps are watcher steps).- Parameters:
runDefaultPostStepLogicOnEmptyWorkflow
- Default is false.
-
getRunDefaultPostApprovalStepLogicOnEmptyWorkflow
public boolean getRunDefaultPostApprovalStepLogicOnEmptyWorkflow() -
withAutoConvertToDeal
Iftrue
then automatically converts quote to deal when quote is approved- Parameters:
autoConvertToDeal
- flag if should be automatically converted
-
isAutoConvertToDeal
-
isMassUpdate
public boolean isMassUpdate()- Returns:
- true If workflow is called from mass update job
-