How process instances are stored in Elasticsearch

For each BPD process instance to index, Process Federation Server creates a JSON instance document and stores it into the index created for the BPD federated system.

Note: This documentation applies only to Process Federation Server set up with an external Elasticsearch cluster.  V20.0.0.2  As of V20.0.0.2, Process Federation Server uses a new version of Elasticsearch (V7.8.0 onwards) as a remote Elasticsearch cluster, while earlier versions use Elasticsearch 6.

In versions prior to V20.0.0.2, instance documents are of the ibmPfsDocument type and their document.subtype field is valued to "instance".  V20.0.0.2  From V20.0.0.2, instance documents no longer have a document type. Their document.subtype field is valued to "instance".

As a consequence, the following Elasticsearch search queries return all the instance documents in an Elasticsearch index named myIndex:
  • Before V20.0.0.2:
    GET http://my.elasticsearch.host:port/myIndex/ibmPfsDocument/_search?q=document.subtype:instance
  • From V20.0.0.2:
    GET http://my.elasticsearch.host:port/myIndex/_doc/_search?q=document.subtype:instance
The identifier of an instance document is the identifier of the related process instance (as a string) prefixed with PI_. For example, the following requests return the instance document for the instance with id 1234 in an Elasticsearch index named myIndex:
  • Before V20.0.0.2:
    GET http://my.elasticsearch.host:port/myIndex/ibmPfsDocument/PI_1234
  • From V20.0.0.2:
    GET http://my.elasticsearch.host:port/myIndex/_doc/PI_1234
The table in Instance document fields for BPD or BPMN process instances lists all the fields that are added to process instances. In addition to these fields, one field for each business data (process parameters) is associated with the process instance. The name of this field depends on the name of the business data or process parameter and its type.
  • bd.parameterName.string for a string
  • bd.parameterName.boolean for a Boolean
  • bd.parameterName.date for a date
  • bd.parameterName.long for a long
  • bd.parameterName.double for a double
For each *.string and *.key field, a keyword field (*.string.keyword or .key.keyword) is used for filtering, sorting, and aggregation.

Instance document fields for BPD or BPMN process instances

The following table lists the parameters that are set for BPD or BPMN process instances.
Table 1. Instance document fields for process instances
Field name Type Definition
document.subtype String Subtype of the document (set to "instance" for an instance document).
instance.piid.key String Identifier of the process instance id.
instance.processinstancename.string String Name of the process instance.
instance.snapshotid.key String Identifier of the process instance snapshot.
instance.snapshotname.string String Name of the process instance snapshot
instance.status.key String Status of the process instance.

For a BPD or BPMN process instance, valid values are: Active, Completed, Failed, Terminated, Did_not_Start and Suspended.

instance.parentcaseid.key String Case identifier of the process. This parameter is set only for BPD or BPMN processes that are started by Case.
instance.parentactivityid.key String Case activity identifier of the process. This parameter is set only for BPD or BPMN processes that are started by Case.
instance.workflowapplication.key String Case solution prefix of the process. This parameter is set only for BPD or BPMN processes that are started by Case.
process.processappacronym.string String Acronym of the process application.
process.processtemplateid.key String For BPD or BPMN process instances: identifier of the BPD in which the process is modeled, prefixed with 25.
process.processtemplatename.key String For BPD or BPMN process instances: name of the process itself.
process.processappname.string String For BPD or BPMN process instances: name of the process application.
process.processappid.key String Identifier of the process application that defines the BPD or BPMN process.
instance.ownergroupid.key String Identifier of the group of users that is the process instance owner. This value matches groups identifiers that are returned by the User Details BPD REST API from a request on the includeInternalMemberships=true, parts=membership, or includeMembershipsAsIDs=true parameters.

For more information

About Elasticsearch indexes
See the Index section of the Elasticsearch documentation.
About Elasticsearch aliases
See the Alias section of the Elasticsearch documentation.
About Elasticsearch search queries
See the Search section of the Elasticsearch documentation.
About Elasticsearch keywords
See the Keyword datatype section of the Elasticsearch documentation.
About Process Federation Server configurable elements
See The Process Federation Server server.xml configuration file.