Activiti: Check impact on supporting UUIDs as Process ID / Key

Created on 2 Nov 2018  路  5Comments  路  Source: Activiti/Activiti

Currently the bpmn process tag has an ID property and currently this ID cannot be a UUID because of the bpmn schema which restricts this property to start with a char different from a number.

In order to avoid this limitation we can rely on a convention such as:
ID-{UUID}

We need to check if this impacts any of the other services such as Query and Audit which are expecting a simple string to be the KEY of the process (which is used to also start process instances).

We also need to check our REST endpoint implementation, which should use the same UUID as resource ID for GET /process-definitions/{id}

api

Most helpful comment

A possible solution could be prefix the UUID with the resource type, for example:

  • processes ID : process-123-123-123-123
  • connector ID : connector-123-123-123-123
  • form ID: form-123-123-123-123

So in general {resourceType}-UUID where resource type can be processes, connector, form, rule ecc...

All 5 comments

Seems that this restriction is part of the standard BPMN schema (see https://www.omg.org/spec/BPMN/20100501/Semantic.xsd) not Activiti specific. The id attribute only accepts a value of type xsd:ID which can't start with a number.

In APS modeller we used to overcome this issue by adding an sid- prefix to all elements where id is a UUID value.

A possible solution could be prefix the UUID with the resource type, for example:

  • processes ID : process-123-123-123-123
  • connector ID : connector-123-123-123-123
  • form ID: form-123-123-123-123

So in general {resourceType}-UUID where resource type can be processes, connector, form, rule ecc...

:+1 let's do that.. so we can standardise across all resources.

@salaboy concerning

We also need to check our REST endpoint implementation, which should use the same UUID as resource ID for GET /process-definitions/{id}

We need to be careful because currently the resource id in the xml is mapped to processKey in the Java model, which has another id to reference the date base id.

@erdemedeiros yes.. exactly.. and we have more resources that the one listed here:

  • process instance
  • process definition
  • tasks
  • process definition metadata

etc

Was this page helpful?
0 / 5 - 0 ratings