Class SplitAndJoinPlugin
- java.lang.Object
-
- org.imixs.workflow.engine.plugins.AbstractPlugin
-
- org.imixs.workflow.engine.plugins.SplitAndJoinPlugin
-
- All Implemented Interfaces:
Plugin
public class SplitAndJoinPlugin extends AbstractPlugin
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
Fields Modifier and Type Field Description static StringINVALID_FORMATstatic StringLINK_PROPERTYstatic StringORIGIN_UPDATEstatic StringSUBPROCESS_CREATEstatic StringSUBPROCESS_SYNCstatic StringSUBPROCESS_UPDATE-
Fields inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT
-
-
Constructor Summary
Constructors Constructor Description SplitAndJoinPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddWorkitemRef(String aUniqueID, ItemCollection workitem)This methods adds a new workItem reference into a workitemprotected voidcopyItemList(String items, ItemCollection source, ItemCollection target)This Method copies the fields defined in 'items' into the targetWorkitem.protected voidcreateSubprocesses(List<String> subProcessDefinitions, ItemCollection originWorkitem)This method expects a list of Subprocess definitions and create for each definition a new subprocess.ItemCollectionrun(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 voidsyncSubprocesses(String originProcessDefinition, ItemCollection subprocessWorkitem)This method syncs the items from the parent into this process instanceprotected voidupdateOrigin(String originProcessDefinition, ItemCollection subprocessWorkitem)This method expects a single process definitions to update the origin process for a subprocess.protected voidupdateSubprocesses(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 Detail
-
LINK_PROPERTY
public static final String LINK_PROPERTY
- See Also:
- Constant Field Values
-
INVALID_FORMAT
public static final String INVALID_FORMAT
- See Also:
- Constant Field Values
-
SUBPROCESS_CREATE
public static final String SUBPROCESS_CREATE
- See Also:
- Constant Field Values
-
SUBPROCESS_UPDATE
public static final String SUBPROCESS_UPDATE
- See Also:
- Constant Field Values
-
ORIGIN_UPDATE
public static final String ORIGIN_UPDATE
- See Also:
- Constant Field Values
-
SUBPROCESS_SYNC
public static final String SUBPROCESS_SYNC
- See Also:
- Constant Field Values
-
-
Method Detail
-
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.- Throws:
ProcessingErrorException- @throws AccessDeniedException @throwsPluginExceptionAccessDeniedException
-
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 formatBoth workitems are connected to each other. The 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. The tag 'action' is optional and allows to overwrite the action result evaluated by the ResultPlugin.1.0.0 100 20 namTeam,_sub_data home - Parameters:
subProcessDefinitions-originWorkitem-- Throws:
AccessDeniedExceptionProcessingErrorExceptionPluginExceptionModelException
-
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)Subprocesses and the origin process are connected to each other. The 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.1.0.0 100 20 namTeam,_sub_data - Parameters:
subProcessDefinitions-originWorkitem-- Throws:
AccessDeniedExceptionProcessingErrorExceptionPluginExceptionModelException
-
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:
AccessDeniedExceptionProcessingErrorExceptionPluginExceptionModelException
-
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:
AccessDeniedExceptionProcessingErrorExceptionPluginExceptionModelException
-
copyItemList
protected void copyItemList(String items, ItemCollection source, ItemCollection target)
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|newitem2Optional also reg expressions are supported. In this case mapping of the item name is not supported.
Example:
(^artikel$|^invoice$),txtTitel|txtNewTitelA reg expression must be includes in brackets.
-
addWorkitemRef
protected void addWorkitemRef(String aUniqueID, ItemCollection workitem)
This methods adds a new workItem reference into a workitem
-
-