Class MicroWorkflowService
- All Implemented Interfaces:
org.imixs.workflow.WorkflowContext,org.imixs.workflow.WorkflowManager
The Service is based on the core concepts of Imixs-Workflow.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor creates a WorkflowContext and a WorkflowKernel -
Method Summary
Modifier and TypeMethodDescriptionorg.imixs.workflow.ItemCollectionevalWorkflowResult(org.imixs.workflow.ItemCollection event, String xmlTag, org.imixs.workflow.ItemCollection documentContext, boolean resolveItemValues) The method evaluates the WorkflowResult for a given BPMN event and returns a ItemColleciton containing all item values of a specified xml tag.org.imixs.workflow.ModelManagerReturns the ModelManager Instanceorg.imixs.workflow.ItemCollectiongetWorkItem(String id) voidinit()voidloadBPMNModel(InputStream inputStream) voidloadBPMNModel(String modelPath) Loads a new modelorg.imixs.workflow.ItemCollectionprocessWorkItem(org.imixs.workflow.ItemCollection workitem) This method processes a workItem by the WorkflowKernel and saves the workitem after the processing was finished successful.protected voidregisterAdapters(org.imixs.workflow.WorkflowKernel workflowkernel) protected voidregisterPlugins(org.imixs.workflow.WorkflowKernel workflowkernel, org.openbpmn.bpmn.BPMNModel model) This method register all plugin classes listed in the model profilevoidremoveWorkItem(org.imixs.workflow.ItemCollection workitem) voidprotected voidupdateMetadata(org.imixs.workflow.ItemCollection workitem) This method updates the workitem metadata.
-
Field Details
-
UNIQUEIDREF
- See Also:
-
READACCESS
- See Also:
-
WRITEACCESS
- See Also:
-
PARTICIPANTS
- See Also:
-
DEFAULT_TYPE
- See Also:
-
INVALID_ITEMVALUE_FORMAT
- See Also:
-
INVALID_TAG_FORMAT
- See Also:
-
adapters
@Inject @Any protected jakarta.enterprise.inject.Instance<org.imixs.workflow.Adapter> adapters
-
-
Constructor Details
-
MicroWorkflowService
public MicroWorkflowService() throws org.imixs.workflow.exceptions.PluginExceptionConstructor creates a WorkflowContext and a WorkflowKernel- Throws:
org.imixs.workflow.exceptions.PluginException
-
-
Method Details
-
init
@PostConstruct public void init() -
setDevice
-
getModelManager
public org.imixs.workflow.ModelManager getModelManager()Returns the ModelManager Instance- Specified by:
getModelManagerin interfaceorg.imixs.workflow.WorkflowContext- Returns:
-
getSessionContext
- Specified by:
getSessionContextin interfaceorg.imixs.workflow.WorkflowContext
-
getDatabase
-
loadBPMNModel
Loads a new model- Parameters:
modelPath-
-
loadBPMNModel
-
removeWorkItem
public void removeWorkItem(org.imixs.workflow.ItemCollection workitem) throws org.imixs.workflow.exceptions.AccessDeniedException - Specified by:
removeWorkItemin interfaceorg.imixs.workflow.WorkflowManager- Throws:
org.imixs.workflow.exceptions.AccessDeniedException
-
getWorkItem
- Specified by:
getWorkItemin interfaceorg.imixs.workflow.WorkflowManager
-
processWorkItem
public org.imixs.workflow.ItemCollection processWorkItem(org.imixs.workflow.ItemCollection workitem) throws org.imixs.workflow.exceptions.AccessDeniedException, org.imixs.workflow.exceptions.ProcessingErrorException, org.imixs.workflow.exceptions.PluginException, org.imixs.workflow.exceptions.ModelException This method processes a workItem by the WorkflowKernel and saves the workitem after the processing was finished successful. The workitem have to provide at least the properties '$modelversion', '$taskid' and '$eventid'Before the method starts processing the workitem, the method load the current instance of the given workitem and compares the property $taskID. If it is not equal the method throws an ProcessingErrorException.
After the workitem was processed successful, the method verifies the property $workitemList. If this property holds a list of entities these entities will be saved and the property will be removed automatically.
- Specified by:
processWorkItemin interfaceorg.imixs.workflow.WorkflowManager- Parameters:
workitem- - the workItem to be processed- Returns:
- updated version of the processed workItem
- Throws:
org.imixs.workflow.exceptions.AccessDeniedException- - thrown if the user has insufficient access to update the workItemorg.imixs.workflow.exceptions.ProcessingErrorException- - thrown if the workitem could not be processed by the workflowKernelorg.imixs.workflow.exceptions.PluginException- - thrown if processing by a plugin failsorg.imixs.workflow.exceptions.ModelException
-
evalWorkflowResult
public org.imixs.workflow.ItemCollection evalWorkflowResult(org.imixs.workflow.ItemCollection event, String xmlTag, org.imixs.workflow.ItemCollection documentContext, boolean resolveItemValues) throws org.imixs.workflow.exceptions.PluginException The method evaluates the WorkflowResult for a given BPMN event and returns a ItemColleciton 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.The method generates a item for each content element and attribute value. e.g.:
<item name="comment" ignore="true">text</item>This example will result in an ItemCollection with the attributes 'comment' with value 'text' and 'comment.ignore' with the value 'true'
Also embedded itemVaues can be resolved (resolveItemValues=true):
<somedata>ABC<itemvalue>$uniqueid</itemvalue></somedata>This example will result in a new item 'somedata' with the $uniqueid prefixed with 'ABC'
- 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:
org.imixs.workflow.exceptions.PluginException- if the xml structure is invalid
-
registerPlugins
protected void registerPlugins(org.imixs.workflow.WorkflowKernel workflowkernel, org.openbpmn.bpmn.BPMNModel model) throws org.imixs.workflow.exceptions.PluginException, org.imixs.workflow.exceptions.ModelException This method register all plugin classes listed in the model profile- Throws:
org.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.ModelException
-
registerAdapters
protected void registerAdapters(org.imixs.workflow.WorkflowKernel workflowkernel) -
updateMetadata
protected void updateMetadata(org.imixs.workflow.ItemCollection workitem) This method updates the workitem metadata. The following items will be updated:- $creator
- $editor
- $lasteditor
- $participants
The method also migrates deprected items.
- Parameters:
workitem-
-