How to store an external task variable before completing a service task in Camunda

Hi,

Can someone help me on the below question?

How to store an external task variable before completing a service task in Camunda?

Note - I am using C# as an external service to handle the logic. In a particular code flow, I am throwing an exception. When I do it the variables I have set before the line where the exception is thrown are lost but I want to retain them to access in the next service tasks.

Hi @Prem_Kumar,

you can set a variable with this API call: https://docs.camunda.org/manual/7.12/reference/rest/process-instance/variables/put-variable/.

Hope this helps, Ingo

Thank you for the response @Ingo_Richtsmeier.Will check this.