cancel
Showing results for 
Search instead for 
Did you mean: 

Capture Process Start and End Dates

pseymour75
Champ in-the-making
Champ in-the-making
Hi All

Apologies for this simple question, but I'm just starting to look at Activiti.

I'm using the Eclipse plugin to create my business processes and what I need to do is capture the process start/finish date and store them as a process variables.

Can someone point me in the right direction of how to do this in Eclipse? (use a script task?)

Many thanks

Paul
3 REPLIES 3

trademak
Star Contributor
Star Contributor
The process instance start date and completion date are stored automatically in the ACT_HI_PROCINST table and you can retrieve the values via the HistoryService.

Best regards,

pseymour75
Champ in-the-making
Champ in-the-making
Hi Trademak

Thank you for the reply.

How could I retrieve these dates and have then stored as a process variable? I want to use this variable values later in my process?

Thanks in advance

Paul

frederikherema1
Star Contributor
Star Contributor
If you want to store the start-date as a variable, you can do this by adding an ExecutionListener to the process (with accompanying Java-class) that writes the current time as a variable and the same can be done for the end of the process (event="end").

If it's not a hard requirement to store those as variables, you can use the Java-api to fetch the HistoricProcessInstance for the process and get the start and potential end-date.