|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WorkItem
Represents one unit of work that needs to be executed. It contains
all the information that it necessary to execute this unit of work
as parameters, and (possibly) results related to its execution.
WorkItems represent a unit of work in an abstract, high-level and
implementation-independent manner. They are created by the engine
whenever an external task needs to be performed. The engine will
delegate the work item to the appropriate WorkItemHandler
for execution. Whenever a work item is completed (or whenever the work
item cannot be executed and should be aborted), the work item manager
should be notified.
For example, a work item could be created whenever an email needs to
be sent. This work item would have a name that represents the type of
work that needs to be executed (e.g. "Email") and parameters related to
its execution (e.g. "From" = "me@mail.com", "To" = ..., "Body" = ..., ...).
Result parameters can contain results related to the execution of this
work item (e.g. "Success" = true).
WorkItemHandler
,
WorkItemManager
Field Summary | |
---|---|
static int |
ABORTED
|
static int |
ACTIVE
|
static int |
COMPLETED
|
static int |
PENDING
|
Method Summary | |
---|---|
long |
getId()
The unique id of this work item |
String |
getName()
The name of the work item. |
Object |
getParameter(String name)
Returns the value of the parameter with the given name. |
Map<String,Object> |
getParameters()
Returns the map of parameters of this work item. |
long |
getProcessInstanceId()
The id of the process instance that requested the execution of this work item |
Object |
getResult(String name)
Returns the value of the result parameter with the given name. |
Map<String,Object> |
getResults()
Returns the map of result parameters of this work item. |
int |
getState()
The state of the work item. |
Field Detail |
---|
static final int PENDING
static final int ACTIVE
static final int COMPLETED
static final int ABORTED
Method Detail |
---|
long getId()
String getName()
int getState()
Object getParameter(String name)
null
if the parameter cannot be found.
name
- the name of the parameter
Map<String,Object> getParameters()
Object getResult(String name)
null
if the result cannot be found.
name
- the name of the result parameter
Map<String,Object> getResults()
long getProcessInstanceId()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |