| com.ecyrd.jspwiki.workflow.Step
All known Subclasses: com.ecyrd.jspwiki.workflow.AbstractStep,
Method Summary | |
public void | addSuccessor(Outcome outcome, Step step) Adds a successor Step to this one, which will be triggered by a supplied
Outcome. | public Outcome | execute()
Executes the processing for this Step and returns an Outcome indicating
if it succeeded (
Outcome.STEP_COMPLETE or
Outcome.STEP_ABORT ). | public Principal | getActor() The Principal responsible for completing this Step, such as a system user
or actor assigned to a Decision. | public Collection | getAvailableOutcomes() Returns a Collection of available outcomes, such as "approve", "deny" or
"reassign", in the order in which they were added via
Step.addSuccessor(Outcome,Step) . | public Date | getEndTime() The end time for this Step. | public List | getErrors() Returns a List of error strings generated by this Step. | public Object[] | getMessageArguments() Returns the message arguments for this Step, typically by delegating to the
parent Workflow's
Workflow.getMessageArguments method. | public String | getMessageKey() Message key for human-friendly name of this Step, including any parameter
substitutions. | public Outcome | getOutcome() Returns the Outcome of this Step's processing; by default,
Outcome.STEP_CONTINUE . | public Principal | getOwner() Convenience method that returns the owner of the Workflow by delegating
to
Workflow.getOwner . | public Date | getStartTime() The start time for this Step. | public Step | getSuccessor(Outcome outcome) Identifies the next Step for a particular Outcome; if there is no next
Step for this Outcome, this method returns null . | public Workflow | getWorkflow() Gets the Workflow that is the parent of this Step. | public boolean | isCompleted() Determines whether the Step is completed; if not, it is by definition
awaiting action by the owner or in process. | public boolean | isStarted() Determines whether the Step has started. | public void | setOutcome(Outcome outcome) Sets the current Outcome for the step. | public void | start() Starts the Step, and sets the start time to the moment when this method
is first invoked. |
addSuccessor | public void addSuccessor(Outcome outcome, Step step)(Code) | | Adds a successor Step to this one, which will be triggered by a supplied
Outcome. Implementations should respect the order in which Outcomes are
added;
Step.getAvailableOutcomes() should return them in the same
order they were added.
Parameters: outcome - the Outcome triggering a particular successor Step Parameters: step - the Step to associated with this Outcomes (null denotes no Steps) |
execute | public Outcome execute() throws WikiException(Code) | |
Executes the processing for this Step and returns an Outcome indicating
if it succeeded (
Outcome.STEP_COMPLETE or
Outcome.STEP_ABORT ). Processing instructions can do just about
anything, such as executing custom business logic or changing the Step's
final outcome via
Step.setOutcome(Outcome) . A return value of
STEP_COMPLETE indicates that the instructions executed completely,
without errors; STEP_ABORT indicates that the Step and its
parent Workflow should be aborted (that is, fail silently without error).
If the execution step encounters any errors, it should throw a
WikiException or a subclass.
Note that successful execution of this methods does not necessarily mean
that the Step is considered "complete"; rather, it just means that it has
executed. Therefore, it is possible that execute could run
multiple times.
the result of the Step, where true means success,and false means abort throws: WikiException - if the step encounters errors while executing |
getActor | public Principal getActor()(Code) | | The Principal responsible for completing this Step, such as a system user
or actor assigned to a Decision.
the responsible Principal |
getAvailableOutcomes | public Collection getAvailableOutcomes()(Code) | | Returns a Collection of available outcomes, such as "approve", "deny" or
"reassign", in the order in which they were added via
Step.addSuccessor(Outcome,Step) . Concrete implementations should
always return a defensive copy of the outcomes, not the original backing
collection.
the set of outcomes |
getEndTime | public Date getEndTime()(Code) | | The end time for this Step. This value should be set when the step
completes. Returns
Workflow.TIME_NOT_SET if not completed yet.
the end time |
getErrors | public List getErrors()(Code) | | Returns a List of error strings generated by this Step. If this Step
generated no errors, this method returns a zero-length array.
the errors |
getMessageArguments | public Object[] getMessageArguments()(Code) | | Returns the message arguments for this Step, typically by delegating to the
parent Workflow's
Workflow.getMessageArguments method.
the message arguments. |
getMessageKey | public String getMessageKey()(Code) | | Message key for human-friendly name of this Step, including any parameter
substitutions. By convention, the message prefix should be a lower-case
version of the Step's type, plus a period (e.g.,
task. and decision. ).
the message key for this Step. |
getOwner | public Principal getOwner()(Code) | | Convenience method that returns the owner of the Workflow by delegating
to
Workflow.getOwner .
the owner of the Workflow |
getSuccessor | public Step getSuccessor(Outcome outcome)(Code) | | Identifies the next Step for a particular Outcome; if there is no next
Step for this Outcome, this method returns null .
Parameters: outcome - the outcome the next step |
getWorkflow | public Workflow getWorkflow()(Code) | | Gets the Workflow that is the parent of this Step.
the workflow |
isCompleted | public boolean isCompleted()(Code) | | Determines whether the Step is completed; if not, it is by definition
awaiting action by the owner or in process. If a Step has completed, it
must also return a non-null result for
Step.getOutcome() .
true if the Step has completed; false if not. |
isStarted | public boolean isStarted()(Code) | | Determines whether the Step has started.
true if the Step has started; false if not. |
setOutcome | public void setOutcome(Outcome outcome)(Code) | | Sets the current Outcome for the step. If the Outcome is a "completion"
Outcome, it should also sets the completon time and mark the Step as
complete. Once a Step has been marked complete, this method cannot be
called again. If the supplied Outcome is not in the set returned by
Step.getAvailableOutcomes() , or is not
Outcome.STEP_CONTINUE or
Outcome.STEP_ABORT , this method returns an
IllegalArgumentException. If the caller attempts to set an Outcome
and the Step has already completed, this method throws an
IllegalStateException.
Parameters: outcome - whether the step should be considered completed |
start | public void start() throws WikiException(Code) | | Starts the Step, and sets the start time to the moment when this method
is first invoked. If this Step has already been started, this method
throws an
. If the Step cannot
be started because the underlying implementation encounters an error,
it the implementation should throw a WikiException.
throws: WikiException - if the step encounters errors while starting |
|
|