Package net.pricefx.common.dto
Class WorkflowDTO.StepDTO<T extends WorkflowDTO.StepDTO>
Object
StepDTO<T>
- Type Parameters:
T- The concrete step type, so that chained calls keep returning the same step type
- Direct Known Subclasses:
WorkflowDTO.ApprovalStepDTO,WorkflowDTO.WatcherStepDTO
- Enclosing class:
WorkflowDTO
Common base of the approval and watcher steps of a workflow. You get a step from
WorkflowDTO.addApprovalStep(String), WorkflowDTO.addWatcherStep(String) or
WorkflowDTO.getStep(String), and configure it by chaining its with* methods.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected BooleanSignals that approvable should be exported and attached to email in the given stepprotected Stringprotected Stringprotected WorkflowDTO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidReturns the comment set bywithAlreadySatisfied(String).Retrieves the attachment sending settingReturns the print template used for the email attachment.Returns the custom properties of the step, added byaddProperty(String, Object).Gets the name of the stepinthashCode()readSingleValue(String name) toMap()Mark current step as already satisfied, workflowengine will skip its processing once marked as satisfied.withAlreadySatisfied(String comment) Mark current step as already satisfied, workflowengine will skip its processing once marked as satisfied.Makes the step send the attachment along with the notification Same aswithEmailAttachment(true)withEmailAttachment(Boolean emailAttachment) Makes the step send the attachment along with the notificationwithEmailAttachmentTemplateName(String emailAttachmentTemplateName) Sets the print template used to export the document attached to the notification email.
-
Field Details
-
workflow
-
properties
-
uniqueName
-
emailAttachment
Signals that approvable should be exported and attached to email in the given step -
emailAttachmentTemplateName
-
alreadySatisfiedComment
-
-
Constructor Details
-
StepDTO
-
-
Method Details
-
getProperties
Returns the custom properties of the step, added byaddProperty(String, Object). The properties are stored with the workflow step.- Returns:
- The properties as a
Map; empty if none were added
-
getUniqueName
Gets the name of the step- Returns:
- The unique name of the step as a
String
-
hashCode
public int hashCode() -
equals
-
withEmailAttachment
Makes the step send the attachment along with the notification Same aswithEmailAttachment(true)- Returns:
- The step itself, for chaining further settings
- See Also:
-
withEmailAttachment
Makes the step send the attachment along with the notificationThe attachment is an export of the document (for example, a Quote PDF) created with the print template set by
withEmailAttachmentTemplateName(String), or with the default print template of the document type. The export contains the header and summary data of the document only, not its line items.Example:
workflow.addApprovalStep("Finance Approval") .withApprovers("Mary", "Bob") .withEmailAttachmentTemplateName("Quote Export - Summary") .withEmailAttachment(true)- Parameters:
emailAttachment- Send attachment (true) or not (false)- Returns:
- The step itself, for chaining further settings
- See Also:
-
getEmailAttachment
Retrieves the attachment sending setting- Returns:
trueif the attachment is sent with the notification,falseotherwise
-
toMap
-
fromMap
-
readSingleValue
-
withEmailAttachmentTemplateName
Sets the print template used to export the document attached to the notification email. Only has an effect together withwithEmailAttachment(Boolean).- Parameters:
emailAttachmentTemplateName- The name of the export or print template as aString; if not set, the default print template of the document type is used- Returns:
- The step itself, for chaining further settings
- See Also:
-
getEmailAttachmentTemplateName
Returns the print template used for the email attachment.- Returns:
- The template name as a
String;nullif the default print template is used - See Also:
-
getAlreadySatisfiedComment
Returns the comment set bywithAlreadySatisfied(String).- Returns:
- The comment as a
String;nullif the step is not marked as already satisfied - See Also:
-
withAlreadySatisfied
Mark current step as already satisfied, workflowengine will skip its processing once marked as satisfied. Same aswithAlreadySatisfied("").- Returns:
- The step itself, for chaining further settings
- See Also:
-
withAlreadySatisfied
Mark current step as already satisfied, workflowengine will skip its processing once marked as satisfied.The step stays in the workflow with the Already Satisfied state. Use it to skip steps that were approved in a previous run of the workflow, for example after the document was denied and submitted again.
Example:
def previous = api.findPreviousWorkflowInfo(quote.typedId, "DENIED", "WITHDRAWN") def skip = previous?.steps?.size() >= 1 && previous.steps[0].approved workflow.addApprovalStep("ApproverWithDefault") .withApprovers("admin") .withAlreadySatisfied(skip ? "Approved in the previous workflow" : null)- Parameters:
comment- If set to non-null value, the execution of the step will skipped and its value used as the step's comment- Returns:
- The step itself, for chaining further settings
- See Also:
-