invoke process instance from micro service

Hello All,

Am very new to camunda , i have an business requirement/scenario as below.

can any one please suggest the same for how can implement it.

Scenario as below:
BPNM Flow -

start - > Task1-> Task2->task3->task4->end

currently my process is at Task3
start - > Task1-> Task2->Task3 → Task4-> E]nd

From Micro service i need to invoke the process to proceed to Task 4 , Task4 is like user task and which user will verify and end the task.

Please let me know the approach and implementation.

Hello @telukuntla

Welcome to the community :slight_smile:

There are different ways to do this, depdending on your your setup (and what Task3 should do).

You could look into message events:

Another way could be to use external task pattern:

I hope that helps.

BR
Michael

thank you michael, i need to step 3 should be complete by Micro service api call.

if possible can you give me a example code snippet with bpnm and micro service logic

Hi @telukuntla

Well, it depends on what you want.

One way of doing this would be to use the external task pattern and let the Task3 be an external task. I have explained the external task pattern in more details here: Options to Invoke - External Task MS from BPMN Flows - #10 by mimaom

Another way would be to use message events to allow some external code (micro service) to signal the process to continue from a certain step (fx Task3), but then you need to change you process and add a message event instead of Task3. Fx something like this where Task3 has been replaced by a message catch event:

In the properties of the message catch event, you need to specify a message name:

image

Using the Camunda REST API you will then be able to send a message to the process engine and the engine will match that event, and the process will then contine to Task4. This is the API endpoint to use for that:

The attribute “messageName” must match the message name from the process (“MyMessage”).

Hope that helps.

BR
Michael