in the process called "subProcess" I need to send a Message type "abortPayment" (via REST API) and automatically terminate with human task "Step 2". It is poossible?
I checked your diagram, as soon as the subprocess is called the parallel gateway is triggered (you should use a start event before the gateway anyway).
The gateway will trigger in parallel both the step2 (Human) and step3 (with message).
So the step2 will already be activated, also if the message is not received.
If you want to trigger the step 2 only after the message is sent, you should move the step2 after the step3.
Out of topic, be careful with end events. In your diagrams you're using terminate end events for the subprocess, that terminate the process instance when reached. They are usually not a good idea when you use parallel gateways.
This is what I want. I give an example: this is for payments. it has two options: or i execute "Step 2" or I sent a message (in future via Engine API) and the "Step 2" should be ignored. The ideia is to have Step 2 in my to do list but if de the sub process recieve a message the step 2 was "done" automatically. it is possible?
Yes it's possible, one way is to use a message boundary event on the task2 (Just drag and drop a catch message event on top of the step2). Without using a step3. You can manage the abort actions in the boundary event outgoing path.
the correlation key is a variable that should be known by both the processes (parent process and sub process). The processInstanceId of the parent can be passed to the child in the call activity, then it can be the correlation.
I create a correlation called processInstanceIdKey (script with processInstanceId). And I try to do the same process. In "Step 1" i send a message via Rest API and it has the same problem, staying in "Step 1" and not pass to the outgoing path ("Step 3").
Bonitasoft empowers development teams with Bonita, the open-source and extensible platform to solve the most demanding process automation use cases. The Bonita platform accelerates delivery of complex applications with clear separation between capabilities for visual programming and for coding. Bonita integrates with existing solutions, orchestrates heterogeneous systems, and provides deep visibility into processes across the organization.