Class SplitAndJoinPlugin
java.lang.Object
org.imixs.workflow.engine.plugins.AbstractPlugin
org.imixs.workflow.engine.plugins.SplitAndJoinPlugin
- All Implemented Interfaces:
Plugin
The Imixs Split&Join Plugin provides functionality to create and update
sub-process instances from a workflow event in an origin process. It is also
possible to update the origin process from the sub-process instance.
The plugin evaluates the txtactivityResult and the items with the following
names:
subprocess_create = create a new subprocess assigned to the current workitem
subprocess_update = update an existing subprocess assigned to the current
workitem
origin_update = update the origin process assigned to the current workitem
A subprocess will contain the $UniqueID of the origin process stored in the
property $uniqueidRef. The origin process will contain a link to the
subprocess stored in the property txtworkitemRef. So both workitems are
linked together.
- Version:
- 1.0
- Author:
- Ralph Soika
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addWorkitemRef
(String aUniqueID, ItemCollection workitem) This methods adds a new workItem reference into a workitemprotected void
copyItemList
(String items, ItemCollection source, ItemCollection target) This Method copies the fields defined in 'items' into the targetWorkitem.protected void
createSubprocesses
(List<String> subProcessDefinitions, ItemCollection originWorkitem) This method expects a list of Subprocess definitions and create for each definition a new subprocess.run
(ItemCollection workitem, ItemCollection event) The method evaluates the workflow activity result for items with name: subprocess_create subprocess_update origin_update For each item a corresponding processing cycle will be started.protected void
syncSubprocesses
(String originProcessDefinition, ItemCollection subprocessWorkitem) This method syncs the items from the parent into this process instanceprotected void
updateOrigin
(String originProcessDefinition, ItemCollection subprocessWorkitem) This method expects a single process definitions to update the origin process for a subprocess.protected void
updateSubprocesses
(List<String> subProcessDefinitions, ItemCollection originWorkitem) This method expects a list of Subprocess definitions and updates each matching existing subprocess.Methods inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
close, getCtx, getWorkflowService, init, mergeFieldList, uniqueList
-
Field Details
-
LINK_PROPERTY
- See Also:
-
INVALID_FORMAT
- See Also:
-
SUBPROCESS_CREATE
- See Also:
-
SUBPROCESS_UPDATE
- See Also:
-
ORIGIN_UPDATE
- See Also:
-
SUBPROCESS_SYNC
- See Also:
-
-
Constructor Details
-
SplitAndJoinPlugin
public SplitAndJoinPlugin()
-
-
Method Details
-
run
public ItemCollection run(ItemCollection workitem, ItemCollection event) throws PluginException, AccessDeniedException, ProcessingErrorException The method evaluates the workflow activity result for items with name: subprocess_create subprocess_update origin_update For each item a corresponding processing cycle will be started.- Parameters:
workitem
- the workitem to be processedevent
- the workflow event containing the processing instructions- Returns:
- updated workitem for further processing
- Throws:
ProcessingErrorException
- @throws AccessDeniedException @throwsPluginException
AccessDeniedException
-
createSubprocesses
protected void createSubprocesses(List<String> subProcessDefinitions, ItemCollection originWorkitem) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException This method expects a list of Subprocess definitions and create for each definition a new subprocess. The reference of the created subprocess will be stored in the property txtworkitemRef of the origin workitem The definition is expected in the following format1.0.0 100 20 namTeam,_sub_data home - Parameters:
subProcessDefinitions
-originWorkitem
-- Throws:
AccessDeniedException
ProcessingErrorException
PluginException
ModelException
-
updateSubprocesses
protected void updateSubprocesses(List<String> subProcessDefinitions, ItemCollection originWorkitem) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException This method expects a list of Subprocess definitions and updates each matching existing subprocess. The definition is expected in the following format (were regular expressions are allowed)1.0.0 100 20 namTeam,_sub_data - Parameters:
subProcessDefinitions
-originWorkitem
-- Throws:
AccessDeniedException
ProcessingErrorException
PluginException
ModelException
-
syncSubprocesses
protected void syncSubprocesses(String originProcessDefinition, ItemCollection subprocessWorkitem) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException This method syncs the items from the parent into this process instance- Parameters:
subProcessDefinitions
-originWorkitem
-- Throws:
AccessDeniedException
ProcessingErrorException
PluginException
ModelException
-
updateOrigin
protected void updateOrigin(String originProcessDefinition, ItemCollection subprocessWorkitem) throws AccessDeniedException, ProcessingErrorException, PluginException, ModelException This method expects a single process definitions to update the origin process for a subprocess. The origin workitem will be loaded by the $uniqueidRef stored in the subprocess The processing definition for the origin process is expected in the following format20 namTeam,_sub_data - Parameters:
originProcessDefinition
-subprocessWorkitem
-- Throws:
AccessDeniedException
ProcessingErrorException
PluginException
ModelException
-
copyItemList
This Method copies the fields defined in 'items' into the targetWorkitem. Multiple values are separated with comma ','.In case a item name contains '|' the target field name will become the right part of the item name.
Example:
txttitle,txtfirstname txttitle|newitem1,txtfirstname|newitem2
Optional also reg expressions are supported. In this case mapping of the item name is not supported.
Example:
(^artikel$|^invoice$),txtTitel|txtNewTitel
A reg expression must be includes in brackets. -
addWorkitemRef
This methods adds a new workItem reference into a workitem
-