Well, my first inclination was close, but not perfect.! Big "swing and a miss" on the ENTITY_INITIALIZED event. But, here's how I was able to get a business key into my process that is started by a signal…
=======================================================================
1. I created a 'reserved' process variable name, let's say "SIGNALSTARTEVENT_BUSINESSKEY"
2. Registered Process ExecutionListener for the "start" event on the process definition.
In the ExecutionListener.notify() method I do this:
3. I always use RuntimeService APIs to signalEventReceived(…….) overload API that takes the Map<String,Object> to include process variables.
Once the process is started by the signal,
4. In the ExecutionListener.notify(), if a process variable exists, I call RuntimeService.updateBusinessKey() with the value of SIGNALSTARTEVENT_BUSINESSKEY.
5. And, then I call "execution.removeVariable(SIGNALSTARTEVENT_BUSINESSKEY)" to clean it out since it is no longer needed.
Hope this helps others solve this problem!
Jason