I have a process that starts by a message, if I send a message REST I succeeded to start the process and, like you can see at the image that I attached, the reponse have the information related the Process Instance started. If I send another message another instance starts, so far so good.
But, what do I have to do if I need to continue the firts instance? (my process waits for another message in order to continue), I tested and I added the “process instance id” to my message because I think that’s the way to correlate the message to the correct instance, and that works, because the instance that I need to continue it continues, but I did that with copy and paste the id string (by hand).
In my Java application, when I start the process I save an entity to the database, and I try to save it with its process instance id (execution.getProcessInstanceId()), when I receive the second message to continue my idea it’s to get the processInstanceId to recover that from the database and update the correspondant entity at the database.
Maybe the real question is if the way that I try to correlate the messages to the correct instance is this the best way?