Understanding workflow process instances

Definition

A Workflow process instances objects, are objects presents during all workflow life cycle. During the execution of the workflow when an user sends information are created objects ( process instance objects ) which can be used in all workflow life cycle. These objects stores in memory the user data. These user data can be used in each workflow node or action.

Types

Basically are 2 process instance objects that can be used in OpenKM:

  • Automatically created by a form submit, when an user submits a form in OpenKM.
  • Created by workflow logic in actions to store some data that can be used in future workflow process.

When the user submits an OpenKM workflow form, the object always are FormElements type. Basically any form submitted by the user will store in memory FormElements type. OpenKM workflows uses FormElements to initialize data values.

For example if you get a form with a element like this:

<input name="var_1" label="Input"/>

When the user submits the form, it will automatically  be stored on memory a object called "var_1" available to all future workflow nodes.

For example if you want to initialize a form value with a value collected during other node, then you should write something like this:

<input name="var_2" label="Input" data="var_1"/>

Note: Each time a form is submited, all form elements are stored to memory indexed by his name. If it was some older object with same name, that it's replaced by newer ( that's something to take in mind ).

OpenKM forms are prepared to use FormElement data type, that's so simply if you're using objects created in previous task form nodes. If in some action you want to create a object that can be used by workflow form elements this should be FormElement type.

For more information look at Workflow forms definition.