How to move data from a message start evento to the following task?

Hi, I am a bit confused on how to pass data from a Message Start Event to a Service task Event.

  1. The start event of the message, received through the Api Rest variables that will be saved in the database.

  1. The event Save Data should connect to an external microservice that save de data in DB.

  1. Once the previous execution ends correctly, the event Validate data should be available .

Problem

My problem is that don´t know how to pass the variables from the start event to the Save event.

If someone could have an example and give me some advices will be very useful, I´m new working with Camunda.

Thanks

Hi @sftr,

when you use another rest endpoint, the process will be started with the process variables from your payload: Correlate a Message | docs.camunda.org

Then you can access the variables in all following tasks.

Hope this helps, Ingo

How I access to the variables from a Service task? I´ve tried implementing java delegate but gives me an error, could you provide me an example please?

Hi @sftr,

please have a look at the code snippet on this section of the documentation: Delegation Code | docs.camunda.org

Hope this helps, Ingo

It works!.
Question, Once all the necessary variables have been obtained, Service Task(Save data) should connect with another microservice, which is the one that stores the data in the database.
Should this be done through an external task or connector? what is the most appropriate way?
image

The other service contains the data base and I just need to send the Json with the data , but I can not find the way.