Send business key with message

I want to know how to use the business key, would you mind guiding me in this way? in the example below for distinguishing different instances in the message event I want to make a random key for each instance from the script task using groovy, but I do not know how to do it.[
process A.bpmn (3.6 KB)
Process B.bpmn (4.8 KB)