Set a variable

I am using Camunda with .NET, is there any way to set a variable when user task is completed as I am required to update a value in database table when a task is completed successfully.

So if you’re using .NET, you’re basically using Camunda’s rest API to communicate with the engine. That rest call dose of course have an option to send variables back to the engine, so it depends on how the implementation of that rest call has been done in your .NET api.

what I am actually trying to do is, log the information of a user task in database tables, I am required to insert the data into table when task instance is created and update the same row when that task is completed.

Are you trying to directly insert data into Camunda’s database tables?

No, I want to insert the data in SQL database

Basically I am trying to implement a functionality which will act like a Task Listener that is why I am required to insert or update the task related data. whenever a instance of a task is created or completed an entry should be made in table.

Might it be sufficient to query the internal database?
/engine-rest/metrics/activity-instance-start/sum will return the total number of instances that have been started.
/engine-rest/metrics/activity-instance-end/sum will return the total number of instances that have ended.

start - end will give you the number of current instance.

There are other REST calls that you can make to get other information about running processes, etc. that might be easier as well.


Thank you @davidgs !
I am trying implement Task Listeners. Is there any way to implement this with C# ?

Hi @Samruddhi_Damushte,

Task listeners run on the JVM in thge process engine. You can implement them either in Java (Delegation Code | or in a scripting language that runs on the JVM (Scripting |

C# is not available here.

Hope this helps, Ingo