Package org.imixs.workflow
Interface WorkflowContext
- All Known Implementing Classes:
WorkflowService
public interface WorkflowContext
This WorkflowContext provides methods to resolve a valid model version and
fetch a thread save instance of a load a
org.openbpmn.bpmn.BPMNModel
.- Version:
- 1.0
- Author:
- imixs.com
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionevalNextTask
(ItemCollection workitem) The method evaluates the next task for a process instance (workitem) based on the current model definition.evalWorkflowResult
(ItemCollection event, String tag, ItemCollection documentContext) The method evaluates the WorkflowResult for a given BPMN event and returns a ItemCollection containing all item values of a specified tag name.evalWorkflowResult
(ItemCollection event, String xmlTag, ItemCollection documentContext, boolean resolveItemValues) The method evaluates the WorkflowResult for a given BPMN event and returns a ItemCollection containing all item values of a specified xml tag.org.openbpmn.bpmn.BPMNModel
fetchModel
(String version) This method returns a exclusive thread save BPMNModel instance.findModelVersionByGroup
(String group) Returns returns the hightest version matching a given workflow group.findModelVersionByRegEx
(String modelRegex) Returns the highest version matching a given regular expression.findModelVersionByWorkitem
(ItemCollection workitem) Returns a valid model version for a given workitem.getWorkItem
(String uniqueid) This method loads a Workitem with the corresponding uniqueid.processWorkItem
(ItemCollection workitem) This method processes a workItem.
-
Method Details
-
fetchModel
This method returns a exclusive thread save BPMNModel instance. The method must not return a shared model instance. The method must throw a ModelException in case no model matching the requested version exists. A client can callfindModelVersionByWorkitem
to resolve a valid model version for a workitem.- Parameters:
version
- - valid model version- Returns:
- an instance of a BPMNModel to be used in a thread save way
- Throws:
ModelException
-
findModelVersionByWorkitem
Returns a valid model version for a given workitem. A model version can also be specified as a regular expression or can be resolved only by a given workflow group. The method must throw a ModelException in case no matching model version exists.- Parameters:
group
- - name of the workflow group- Returns:
- version matching the params of the given workitem
- Throws:
ModelException
-
findModelVersionByRegEx
Returns the highest version matching a given regular expression. The method must throw a ModelException in case no matching model version exists.- Parameters:
modelRegex
- - regular expression- Returns:
- version matching the regex
- Throws:
ModelException
-
findModelVersionByGroup
Returns returns the hightest version matching a given workflow group. The method must throw a ModelException in case no matching model version exists.- Parameters:
group
- - name of the workflow group- Returns:
- version matching the group
- Throws:
ModelException
-
getWorkItem
This method loads a Workitem with the corresponding uniqueid. -
processWorkItem
ItemCollection processWorkItem(ItemCollection workitem) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException This method processes a workItem. A workitem have to provide at least the properties '$modelversion', '$taskid' and '$eventid'- Parameters:
workitem
- - the workItem to be processed- Returns:
- updated version of the processed workItem
- Throws:
AccessDeniedException
- - thrown if the user has insufficient access to update the workItemProcessingErrorException
- - thrown if the workitem could not be processed by the workflowKernelPluginException
- - thrown if processing by a plugin failsModelException
-
evalNextTask
The method evaluates the next task for a process instance (workitem) based on the current model definition. A Workitem must at least provide the properties $TASKID and $EVENTID.- Returns:
- Task entity
- Throws:
PluginException
ModelException
-
evalWorkflowResult
ItemCollection evalWorkflowResult(ItemCollection event, String xmlTag, ItemCollection documentContext, boolean resolveItemValues) throws PluginException The method evaluates the WorkflowResult for a given BPMN event and returns a ItemCollection containing all item values of a specified xml tag. Each tag definition must contain at least a name attribute and may contain an optional list of additional attributes.- Parameters:
event
-xmlTag
- - XML tag to be evaluateddocumentContext
-resolveItemValues
- - if true, itemValue tags will be resolved.- Returns:
- eval itemCollection or null if no tags are contained in the workflow result.
- Throws:
PluginException
- if the xml structure is invalid
-
evalWorkflowResult
ItemCollection evalWorkflowResult(ItemCollection event, String tag, ItemCollection documentContext) throws PluginException The method evaluates the WorkflowResult for a given BPMN event and returns a ItemCollection containing all item values of a specified tag name. Each tag definition of a WorkflowResult contains a name and a optional list of additional attributes. The method generates a item for each content element and attribute value.
e.g.- text
will result in the attributes 'comment' with value 'text' and 'comment.ignore' with the value 'true'- Parameters:
event
-tag
- - tag to be evaluateddocumentContext
-- Returns:
- Throws:
PluginException
-