Class VersionPlugin
- All Implemented Interfaces:
Plugin
The Plugin depends on the org.imixs.workflow.jee.ejb.WorkflowManager. So the Plugin can not be used in other implementations.
The creation and management of a new version is defined by the workflow model (See Imixs Modeler) There are currently two modes supported (provided by the activity property 'keyVersion')
mode=1 indicates that the plugin should create a new version of the current workitem. The two workitems are identically except the attributes $uniqueid and $workitemidRef. The attribute workitemidRef points to the $uniqueid form the source workitem. So the availability of this property indicates that the workitem is a version of source workitem with this $uniqueid. The source workitem has typically no $workitemidRef attribute. The Source Workitem is also named Master Version. After the new version is created the plugin processes the version with the activity provided by the model (numVersionActivityID) if provided by the model.
2=indicates that the plugin should convert a existing version into a Master Version. This means that the $workitemIDRef will be nulled. An existing Master Version will be processed by the activity provided by the model (numVersionActivityID). Also the $workitemidRef will be set to the current $workitemID.
If an error occured during the workflow process this plugin will throw a new ejbexception in the close() method to cancel the current transaction. So no changes will be saved by the ejb container
- Version:
- 1.0
- Author:
- Ralph Soika
- See Also:
-
org.imixs.workflow.jee.ejb.WorkflowManager
-
Field Summary
Fields inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateVersion
(ItemCollection sourceItemCollection) This method creates a new instance of a exiting workitem.static boolean
isProcssingVersion
(ItemCollection adocumentContext) returns true in case a new version is created based on the currentWorkitemrun
(ItemCollection adocumentContext, ItemCollection adocumentActivity) creates a new version or converts a version into the MasterVersion depending to the activity attribute "keyVersion" provided by the workflow model.void
setVersion
(ItemCollection version) Methods inherited from class org.imixs.workflow.engine.plugins.AbstractPlugin
close, getCtx, getWorkflowService, init, mergeFieldList, uniqueList
-
Field Details
-
INVALID_CONTEXT
- See Also:
-
INVALID_WORKITEM
- See Also:
-
-
Constructor Details
-
VersionPlugin
public VersionPlugin()
-
-
Method Details
-
getVersion
-
setVersion
-
run
public ItemCollection run(ItemCollection adocumentContext, ItemCollection adocumentActivity) throws PluginException creates a new version or converts a version into the MasterVersion depending to the activity attribute "keyVersion" provided by the workflow model. If a new version is created and be processed the plugin adds the attribute '_versionprocessing' = true to indicate this situation for other plugins. Other plugins can determine the $processingversion mode by calling the method isProcssingVersion(). The attribute will be removed after a version was processed.- Parameters:
adocumentContext
- the workitem to be processedadocumentActivity
- the workflow event containing the processing instructions- Returns:
- updated workitem for further processing
- Throws:
PluginException
-
isProcssingVersion
returns true in case a new version is created based on the currentWorkitem- Parameters:
workitem
-documentActivity
-- Returns:
-
createVersion
This method creates a new instance of a exiting workitem. The method did not save the workitem!. The method can be subclassed to modify the new created version. The new property $WorkitemIDRef will be added which points to the $uniqueID of the sourceWorkitem.- Parameters:
sourceItemCollection
- the ItemCollection which should be versioned- Returns:
- new version of the source ItemCollection
- Throws:
PluginException
Exception
-