Imixs Workflow ...the open source workflow technology for business applications

Core API

How to manage business data

In a business application you typically manage information which need to be distributed in a predefined way. Users edit data, which need to be made available for various actors.

The data which is processed by a workflow management system is stored in a workitem. A workitem holds the data, which is usually edited by a user into a form. This data is called the business data. When a workflow management system processes a workitem, also workflow data will be generated and added into a workitem. So a workitem holds business data, entered by a user, and also processing information generated by the workflow system.

Business data

To manage the data of a workitem, the Imixs Workflow project provides the java class ItemCollection. The ItemCollection is a generic data object, which can contain any data types. There are no restrictions in the amount or size of the data stored into an ItemCollection. This is a example how to use the ItemCollection object:

  import org.imixs.workflow.ItemCollection;
  .....
  ItemCollection workitem=new ItemCollection();
  workitem.replaceItemValue("name","Ralph");
  workitem.replaceItemValue("age",new Integer(40));

Each value stored into a ItemCollection has a item-name and a item-value. The item-name identifies a specific part of data contained in a ItemCollection. You can access a item-value by its name:

  ....
  String name=workitem.getItemValueString("name");
  int age=workitem.getItemValueInteger("age");
  ....

Workflow data

As explained before, a workitem can not only contain business data, but also workflow information, generated by the workflow system. For example, a workitem processed by the Imixs Workflow, contains data like the creation date or the processing status. This is an example how to access this kind of data:

  String uniqueID=workitem.getItemValueInteger("$UniqueID");
  int processID=workitem.getItemValueInteger("$ProcessID");
  Date created=workitem.getItemValueDate("$created");
  Date modified=workitem.getItemValueDate("$modified");
  String status=workitem.getItemValueString("txtWorkflowStatus");
  Vector history=workitem.getItemValue("txtWorkflowHistory");

The following table provides an overview about the properties provided by the Imixs Workflow Engine. The column 'read/write' indicates if the property can be controlled by an application:

Core PropertiesTyperead/ 
write
Description
$ModelVersionStringyesThe Version of the model the workitem belongs to
$ProcessIDIntegeryesThe current ProcessID of the workItem
$ActivityIDIntegeryesThe next activity to be processed by the workflow engine
$CreatedDatenoDate of creation
$ModifiedDatenoDate of last modification
$IsAuthorBooleannoIndicates if the current user has write access
$ReadAccessListnoString list of User/Roles with read access
$WriteAccessListnoString list of User/Roles with write access
$uniqueIdStringnoThe unique ID of this workItem
$uniqueIdRefStringyesA reference to a connected workItem (child process)
$workitemidStringnoThe process instance id of this workitem
Status Information
namcreatorStringnoThe user who created the workItem.
namCurrentEditorStringnoThe user who invoked the processWorkitem() method.
namOwnerListnoString list of User/Roles, that are owners of that WorkItem.
txtworkflowgroupStringnoThe name of the current process group
txtworkflowstatusStringnoThe name of the current workflow status
txtworkflowsummaryStringnoA short description of the current status
txtworkflowabstractStringnoA long description of the current status
txtworkflowimageurlStringnoA link to an image which displays the current status
txtworkflowhistorylogListnoHistory of all processed activities
txtworkflowresultmessageStringnoThe result message of last process step
Logging Information
txtworkflowactivitylogListnoLog of processed workflow activities
txtworkflowpluginlogListnoThe plugin execution log
timworkflowlastaccessDatenoThe timestamp of the last processing action
numlastactivityidIntegernoThe last processed workflow activity ID
namlasteditorStringnoThe last user, that invoked the process method