For failed tasks Date is not coming


#1

Hi
I am facing an issue with date.
whenever task getting failed I am not able set start date.How to set that date??
please help me anyone


#2

@swathi what’s the date format are you trying to set?

Camunda uses ISO date format yyyy-MM-dd’T’HH:mm:ss.SSSZ e.g., 2016-01-25T13:33:42.165+0100

For custom date format check this link


#3

I am using correct date format only but the issue is with the failed tasks.
when the task is getting failed how to get the date?


#4

If its a service task, you can handle the exception in catch block, and you can set variables either globally for that process instance or locally for that task. Configure TaskListener on end event, or if you have configured JavaDelegate then you can store the time using below function in delegates.

execution.setVariable(variableName, value, activityId);

(or)

execution.setVariableLocal(variableName, value);

#5

Thank you so much