We are going to be storing some business data logically belonging to a process instance in a database external to the Camunda database. The general question is what should we use as the key for a specific process instance? Should we use the Camunda processInstanceId? If so, say that I have a service task implemented as an external task. I would like that external task to have access to the processInstanceId for the purpose of storing or retrieving data from the external database. How do I make the processInstanceId accessible to the external task? Thanks
Hi @Chuck_Irvine,
my recommendation to your topic is to save a link to process instance in your business data.
In former projects I found it very helpful to have this link in the business data to access the process instance quickly.
But, I would not use the processInstanceId for this and use the businessKey instead, because you have more flexibilty and don’t provide internal information of the process engine.
With the businessKey, you are able to link the data to a second or third process instance and you can delete and restart (not really needed in the age of process instance modification and migration) the process instance if needed.
Hope this help, Ingo
After posting my issue and doing additional reading, I came to the same conclusion. Thanks!