Package org.kie.api.runtime.process
Interface WorkItem
- 
 public interface WorkItemRepresents 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 appropriateWorkItemHandlerfor 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).- See Also:
- WorkItemHandler,- WorkItemManager
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetId()The unique id of this work itemStringgetName()The name of the work item.ObjectgetParameter(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.longgetProcessInstanceId()The id of the process instance that requested the execution of this work itemObjectgetResult(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.intgetState()The state of the work item.
 
- 
- 
- 
Field Detail- 
PENDINGstatic final int PENDING - See Also:
- Constant Field Values
 
 - 
ACTIVEstatic final int ACTIVE - See Also:
- Constant Field Values
 
 - 
COMPLETEDstatic final int COMPLETED - See Also:
- Constant Field Values
 
 - 
ABORTEDstatic final int ABORTED - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getIdlong getId() The unique id of this work item- Returns:
- the id of this work item
 
 - 
getNameString getName() The name of the work item. This represents the type of work that should be executed.- Returns:
- the name of the work item
 
 - 
getStateint getState() The state of the work item.- Returns:
- the state of the work item
 
 - 
getParameterObject getParameter(String name) Returns the value of the parameter with the given name. Parameters can be used to pass information necessary for the execution of this work item. Returnsnullif the parameter cannot be found.- Parameters:
- name- the name of the parameter
- Returns:
- the value of the parameter
 
 - 
getParametersMap<String,Object> getParameters() Returns the map of parameters of this work item. Parameters can be used to pass information necessary for the execution of this work item.- Returns:
- the map of parameters of this work item
 
 - 
getResultObject getResult(String name) Returns the value of the result parameter with the given name. Result parameters can be used to pass information related the result of the execution of this work item. Returnsnullif the result cannot be found.- Parameters:
- name- the name of the result parameter
- Returns:
- the value of the result parameter
 
 - 
getResultsMap<String,Object> getResults() Returns the map of result parameters of this work item. Result parameters can be used to pass information related the result of the execution of this work item.- Returns:
- the map of results of this work item
 
 - 
getProcessInstanceIdlong getProcessInstanceId() The id of the process instance that requested the execution of this work item- Returns:
- the id of the related process instance
 
 
- 
 
-