|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ActionService
The service provided by an action.
The service is a major part of an action as it defined its behavior within a workflow. It describes how the element performs during the workflow execution. For an action, the service describes:
isValidInputClass(Class)
method.outputClass(Class)
method.execute(Object, Parameters)
method.
Action.getService()
Method Summary | |
---|---|
void |
addExecutionListener(ActionExecutionListener l)
Adds a listener to the execution. |
java.lang.Object |
execute(java.lang.Object input,
Parameters parameters)
Executes the action. |
boolean |
isValidInputClass(java.lang.Class<? extends java.lang.Object> clazz)
Returns true if an instance of the given class is an
acceptable input. |
java.lang.Class<? extends java.lang.Object> |
outputClass(java.lang.Class<? extends java.lang.Object> inputClazz)
Returns the class of the object returned by the execute
method, depending on the class of the object received as an input. |
void |
removeExecutionListener(ActionExecutionListener l)
Removes a listener to the execution. |
Method Detail |
---|
java.lang.Object execute(java.lang.Object input, Parameters parameters) throws ActionExecutionException
The method receives as an input the result of the previous action in the
workflow, casted in the input type of the action. As it might appends
that the action is the first one of the workflow, or that the previous
one did not generate an output compatible with the expected input of this
one, the value received as a parameter might be null
. The
method should handle this case in order to avoid workflow execution
errors.
This method returns the result of the execution, which will be used as
input of the next action. Action(s) considers that the execution
of the action is successful if no exception is raised during its
execution. If the result of this function is null
, it will
be considered as successful and the workflow will continue its execution.
An ActionExecutionException
means that the action failed during
its execution. Such an exception (and any other exception) will result in
ending the workflow execution.
If the action is not supposed to return any output (result of the
outputClass(Class)
method is Void
), it returns a
null
object.
input
- - the result of the previous actionparameters
- - the settings related to this action, to apply for this
execution.
ActionExecutionException
- - if the execution failedjava.lang.Class<? extends java.lang.Object> outputClass(java.lang.Class<? extends java.lang.Object> inputClazz)
execute
method, depending on the class of the object received as an input.
inputClazz
- - the class of the object that will be received as an input
execute
methodisValidInputClass(Class)
boolean isValidInputClass(java.lang.Class<? extends java.lang.Object> clazz)
true
if an instance of the given class is an
acceptable input.
clazz
- - the tentative class
true
if an instance of the given class is an
acceptable input. false
otherwise.outputClass(Class)
void addExecutionListener(ActionExecutionListener l)
l
- - new listener.removeExecutionListener(ActionExecutionListener)
void removeExecutionListener(ActionExecutionListener l)
l
- - listener to removeaddExecutionListener(ActionExecutionListener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |