public class VersionPlugin extends AbstractPlugin
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
jee.ejb.WorkflowManager| Modifier and Type | Field and Description |
|---|---|
static String |
INVALID_CONTEXT |
static String |
INVALID_WORKITEM |
INVALID_ITEMVALUE_FORMAT, INVALID_PROPERTYVALUE_FORMAT| Constructor and Description |
|---|
VersionPlugin() |
| Modifier and Type | Method and Description |
|---|---|
ItemCollection |
createVersion(ItemCollection sourceItemCollection)
This method creates a new instance of a exiting workitem.
|
ItemCollection |
getVersion() |
static boolean |
isProcssingVersion(ItemCollection adocumentContext)
returns true in case a new version is created based on the
currentWorkitem
|
ItemCollection |
run(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) |
close, getCtx, getWorkflowService, init, mergeFieldList, uniqueListpublic static final String INVALID_CONTEXT
public static final String INVALID_WORKITEM
public ItemCollection getVersion()
public void setVersion(ItemCollection version)
public ItemCollection run(ItemCollection adocumentContext, ItemCollection adocumentActivity) throws PluginException
PluginExceptionpublic static boolean isProcssingVersion(ItemCollection adocumentContext)
documentContext - documentActivity - public ItemCollection createVersion(ItemCollection sourceItemCollection) throws PluginException
sourceItemCollection - the ItemCollection which should be versionedPluginExceptionExceptionCopyright © 2006–2019 Imixs Software Solutions GmbH. All rights reserved.