How to get the date a task became available.

1
0
-1

Is there a groovy script or any other way to find the date when the process moves to the next task?

1 answer

1
0
-1

Hi,

I suggest creating a BusinessObject ProcessTracker that stores a lastUpdate attribute (of type DATE-TIME (TIMEZONE) and a processInstanceId (type LONG) (at least for your use case)

Then on each process you want to track, create a business variable of tracker of type ProcessTracker with a default value of:

def trackerVar = new ProcessTracker()
trackerVar.lastUpdate = OffsetDateTime.now()
trackerVar.processInstanceId = processInstanceId
return trackerVar

Then on each HumanTask (or event automatic), add an operation that updates the lastUpdate attribute of the variable with the current time (OffsetDateTime.now())

You can retrieve the lastUpdate value in a UID task form using the context variable and a new External API variable tracker with URL ../{{context.tracker_ref.link}}

HTH
Romain

Notifications