Business Key definition and uses

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?

Thanks guys!

1 Like

Hi,

this thread may be of interest…

Of course I may be a little biased :wink:

regards

Rob

1 Like

Great @Webcyberrob. I think thats great base material.

Know of any consolidate writeup of all the places and details about to quote from your thread:

  1. extra privileges
  2. it can enable some convenient and efficient functions

Thanks

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.

2 Likes

@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?

Hi Stephen

I think one of the main advantages of using business key is that it is indexed in the database
and being indexed means that update operations will affect the performance

@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.

Hi Stephen,
Yes…I guess that’s the reason. to improve the performance of queries

Hi all,

I published a blog post that summarizes the discussion here and provides some hacks to generate the business key from within the process instance: https://blog.camunda.com/post/2018/10/business-key/

Cheers,
Thorben

3 Likes

@thorben great job! hope you can find the time to post most content like this.

Hi,

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?

Thx

Just wait one week. It’s a new feature of Camunda 7.10: https://blog.camunda.com/post/2018/10/camunda-bpm-7100-alpha5-released/

It will be released on Nov. 30th.

Cheers, Ingo

2 Likes

Hi Ingo,

With the 7.10 release, Do we need the workarounds mentioned in the following link for setting a business key?

I have yet to try the new version.

Thanks,
Anand

Hi @aalagappa,

no workaround needed anymore: https://docs.camunda.org/manual/7.10/user-guide/process-engine/delegation-code/#set-business-key-from-delegation-code

Cheers, Ingo