Was looking for a consolidate definition and uses of the Business key in Camunda. Found various references to where it is used, but noticed that Camunda docs do not seem to have a actual consolidate definition/explanation of the business key. Is this located somewhere?
Various API calls (for example message correlation) are made a lot easier by using a Business Key.
Also if a process initializes many other processes through Call Activities it becomes easier to find all children of a given process if they all share the same business key.
@Niall, when you say “easier” do you just mean that there is a specific field to match against rather than using process variables?
From what i can tell from the API Docs, whenever there are times where you would use the business key as a filter/search criteria (example: finding all process instances with the specific business key), you can also use the process variables.
Is there any benefits of the business key over process variables, where the “feature” or “benefit” does not have a process variable equivalent?
The biggest barrier we find to using the business key is its inability to set the business key after the process has started. Can a business key be set as part of a start event execution listener?
@hassang good point! Is that documented anywhere? How much of a performance benefit are we talking? I know the difference between indexed and not indexed from a DB standpoint. So my assumption would be if you are looking for highest level of performance from camunda, we should be using business key due to the index.
So, how to set a business key after the process has started?
In my process I get an OrderId from a DB in the very first task.
I want to set this as a business key in the next task, so to use it later in the process.
Any simple delegate code to do that?