Accessing additional data on process instances
Apart from the process parameter values, a few other information are stored on process instances and are available to be used while evaluating business rules. They can be references in the MVEL code from the business rules under the additionalData key.
1
additionalData.get("KEY_NAME");
Copied!
Some of these information are the ones related to the process owner, the user that started the process instance. Each process instance stores, for each swimlane, the owner related info: firstName, lastName, username, roles, groups, the jwt token and any custom attributes defined while setting up the identity provider. These can be accessed by getting the securityDetails key from the additionalData for each process instance.
The details about an owner are stored under the following keys:
  • SWIMLANE_NAME.owner.username
  • SWIMLANE_NAME.owner.identifier
  • SWIMLANE_NAME.owner.details.firstName
  • SWIMLANE_NAME.owner.details.lastName
  • SWIMLANE_NAME.owner.details.email
  • SWIMLANE_NAME.owner.details.jwt
  • SWIMLANE_NAME.owner.details.roles
  • SWIMLANE_NAME.owner.details.groups
  • SWIMLANE_NAME.owner.details.attributes
These values can be used in the MVEL code as follows:
With version 1.16.0 we introduced the swimlane name in the grouping of the owner related information.
Example for versions 1.16.0 and up:
1
securityDetails = additionalData.get("securityDetails");
2
if(securityDetails.get("Default.owner.userName") != null){
3
// do something with the username of the process instance owner
4
}
5
if(securityDetails.get("Default.owner.details.firstName") != null){
6
// do something with the first name of the process instance owner
7
}
Copied!
Example for deprecated versions previous to 1.16.0:
1
securityDetails = additionalData.get("securityDetails");
2
if(securityDetails.get("owner.firstName") != null){
3
// do something with the first name of the process instance owner
4
}
Copied!
Copy link