Package org.apache.wiki.workflow
Class Task
java.lang.Object
org.apache.wiki.workflow.AbstractStep
org.apache.wiki.workflow.Task
- All Implemented Interfaces:
Serializable,Step
- Direct Known Subclasses:
PreSaveWikiPageTask,SaveUserProfileTask,SaveWikiPageTask
AbstractStep subclass that executes instructions, uninterrupted, and results in an Outcome. Concrete classes only need to implement
AbstractStep.execute(org.apache.wiki.api.core.Context). When the execution step completes, execute must return Outcome.STEP_COMPLETE,
Outcome.STEP_CONTINUE or Outcome.STEP_ABORT. Subclasses can add any errors by calling the helper method
AbstractStep.addError(String). The execute method should generally capture and add errors to the error list instead of
throwing a WikiException.
- Since:
- 2.5
- See Also:
-
Field Summary
Fields inherited from interface org.apache.wiki.workflow.Step
TIME_NOT_SET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal PrincipalgetActor()ReturnsSystemPrincipal.SYSTEM_USER.final StepIdentifies the next Step after this Task finishes successfully.final voidsetSuccessor(Step step) Sets the successor Step to this one, which will be triggered if the Task completes successfully (that is,Step.getOutcome()returnsOutcome.STEP_COMPLETE.Methods inherited from class org.apache.wiki.workflow.AbstractStep
addError, addSuccessor, execute, getAvailableOutcomes, getEndTime, getErrors, getMessageKey, getOutcome, getStartTime, getSuccessor, getWorkflowContext, getWorkflowId, isCompleted, isStarted, setOutcome, setWorkflow, start
-
Constructor Details
-
Task
Public constructor that creates a new Task with a specified message key. After construction, the protected methodAbstractStep.setWorkflow(int, Map)should be called.- Parameters:
messageKey- the Step's message key, such asdecision.editPageApproval. By convention, the message prefix should be a lower-case version of the Step's type, plus a period (e.g.,task.anddecision.).
-
Task
Constructs a new instance of a Task, with an associated Workflow and message key.- Parameters:
workflowId- the parent workflow id to setworkflowContext- the parent workflow context to setmessageKey- the i18n message key
-
-
Method Details
-
getActor
ReturnsSystemPrincipal.SYSTEM_USER.- Specified by:
getActorin interfaceStep- Specified by:
getActorin classAbstractStep- Returns:
- the system principal
-
setSuccessor
Sets the successor Step to this one, which will be triggered if the Task completes successfully (that is,Step.getOutcome()returnsOutcome.STEP_COMPLETE. This method is really a convenient shortcut forStep.addSuccessor(Outcome, Step), where the first parameter isOutcome.STEP_COMPLETE.- Parameters:
step- the successor
-
getSuccessor
Identifies the next Step after this Task finishes successfully. This method will always return the value set in methodsetSuccessor(Step), regardless of the current completion state.- Returns:
- the next step
-