Package net.pricefx.common.dto
Class WorkflowDTO.WatcherStepDTO
- Enclosing class:
WorkflowDTO
public static class WorkflowDTO.WatcherStepDTO
extends WorkflowDTO.StepDTO<WorkflowDTO.WatcherStepDTO>
A watcher step of the workflow: its recipients are notified by email when the step becomes active, but they
cannot approve or deny. Returned by
WorkflowDTO.addWatcherStep(String).
The recipients are users, user groups or email addresses; the last of these set wins.
Example:
workflow.addWatcherStep("Review")
.withUserGroupWatchers("Managers")
.withReasons("Status update")
- See Also:
-
Field Summary
Fields inherited from class WorkflowDTO.StepDTO
alreadySatisfiedComment, emailAttachment, emailAttachmentTemplateName, properties, uniqueName, workflow -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddProperty(String name, Object value) Adds a custom property to the step.voidString[]Gets the list of email addresses if specified as recipient for this nodeDeprecated.Returns the reason textDeprecated.UsegetUserGroupWatchers()instead.Gets user group names in case of group watchers (or null otherwise)Deprecated.UsegetUserWatchers()instead.Return the current watchers (or null if none set or if group watchers)Sets one explanation reason for the watcher step.Sets explanation reasons for the watcher step, one for each watcher.toMap()withEmailListWatcher(String... emails) Instead of specifying a user name or a user group, arbitrary email addresses can be used here Last invoked ofwithUserWatchers(String...),withUserGroupWatchers(String...),withEmailListWatcher(String...)winswithReasons(String... reasons) Sets explanations for the watcher step.withUserGroupWatcher(String userGroupUniqueName) Deprecated.UsewithUserGroupWatchers(String...)instead.withUserGroupWatchers(String... userGroupUniqueNames) Specify user groups as recipient Last invoked ofwithUserWatchers(String...),withUserGroupWatchers(String...),withEmailListWatcher(String...)winswithUserWatcher(String userLoginName) Deprecated.UsewithUserWatchers(String...)instead.withUserWatchers(String... userLoginNames) Specify users as recipients Last invoked ofwithUserWatchers(String...),withUserGroupWatchers(String...),withEmailListWatcher(String...)winsMethods inherited from class WorkflowDTO.StepDTO
equals, getAlreadySatisfiedComment, getEmailAttachment, getEmailAttachmentTemplateName, getProperties, getUniqueName, hashCode, readSingleValue, withAlreadySatisfied, withAlreadySatisfied, withEmailAttachment, withEmailAttachment, withEmailAttachmentTemplateName
-
Constructor Details
-
WatcherStepDTO
-
-
Method Details
-
withUserWatcher
Deprecated.UsewithUserWatchers(String...)instead.Specify a user as recipient Last invoked ofwithUserWatcher(String),withUserGroupWatcher(String),withEmailListWatcher(String...)wins- Parameters:
userLoginName- The login name of the watcher- Returns:
- The watcher step itself.
-
withUserWatchers
Specify users as recipients Last invoked ofwithUserWatchers(String...),withUserGroupWatchers(String...),withEmailListWatcher(String...)winsExample:
workflow.addWatcherStep("Info").withUserWatchers("mary", "bob")- Parameters:
userLoginNames- The login names of the watchers- Returns:
- The watcher step itself.
- See Also:
-
withUserGroupWatcher
Deprecated.UsewithUserGroupWatchers(String...)instead.Specify user group as recipient Last invoked ofwithUserWatcher(String),withUserGroupWatcher(String),withEmailListWatcher(String...)wins- Parameters:
userGroupUniqueName- The unique name of the watching user group- Returns:
- The watcher step itself.
-
withUserGroupWatchers
Specify user groups as recipient Last invoked ofwithUserWatchers(String...),withUserGroupWatchers(String...),withEmailListWatcher(String...)winsExample:
workflow.addWatcherStep("Review").withUserGroupWatchers("Managers")- Parameters:
userGroupUniqueNames- The unique names of the watching user groups- Returns:
- The watcher step itself.
- See Also:
-
withEmailListWatcher
Instead of specifying a user name or a user group, arbitrary email addresses can be used here Last invoked ofwithUserWatchers(String...),withUserGroupWatchers(String...),withEmailListWatcher(String...)winsInvalid email addresses make the workflow fail with an error that lists them.
Example:
workflow.addWatcherStep("Customer Service").withEmailListWatcher("cs@example.com")- Parameters:
emails- The email addresses of the recipients- Returns:
- The watcher step itself.
- See Also:
-
addProperty
Adds a custom property to the step. The properties are stored with the workflow step.- Parameters:
name- The property namevalue- The property value- Returns:
- The watcher step itself.
- See Also:
-
setReason
Sets one explanation reason for the watcher step.- Parameters:
reason- The reason as aString- Returns:
- The watcher step itself.
- See Also:
-
setReason
Sets explanation reasons for the watcher step, one for each watcher. -
withReasons
Sets explanations for the watcher step.Example:
workflow.addWatcherStep("Review") .withUserWatchers("w1", "w2") .withReasons("Margin below target", "FYI")- Parameters:
reasons- The reasons why each watcher is notified. The reasons match watchers. E.g. if you have 3 watchers (w1, w2, w3), you can specify up to 3 reasons (r1, r2, r3) and then r1 corresponds to w1, r2 to w2 etc. If you want to put multiple reasons to a single watcher, you need to join the strings and return a single combined reason in the code.- Returns:
- The watcher step itself.
- See Also:
-
getUserWatcher
Deprecated.UsegetUserWatchers()instead.Return the current watcher (or null if none set or if group watcher)- Returns:
- The user name
-
getUserWatchers
Return the current watchers (or null if none set or if group watchers)- Returns:
- The user names
- See Also:
-
getReason
Deprecated.UsegetReasons()instead.Returns the reason text- Returns:
- The reason
-
getReasons
Returns the reason text- Returns:
- The reason
- See Also:
-
getUserGroupWatcher
Deprecated.UsegetUserGroupWatchers()instead.Gets user group name in case of group watcher (or null otherwise)- Returns:
- The user group unique name as a
String, ornull
-
getUserGroupWatchers
Gets user group names in case of group watchers (or null otherwise) -
getEmailListWatcher
Gets the list of email addresses if specified as recipient for this node- Returns:
- The email addresses as a
Stringarray, ornullif none were specified - See Also:
-
toMap
- Overrides:
toMapin classWorkflowDTO.StepDTO<WorkflowDTO.WatcherStepDTO>
-
fromMap
- Overrides:
fromMapin classWorkflowDTO.StepDTO<WorkflowDTO.WatcherStepDTO>
-
getReasons()instead.