How to access process Instance start time in a script task?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2020 10:49 AM
Hi, I'm trying to access a process instance start time within a script task.
Written in Javascript, I currently have
try{ //Get Process ID procID = execution.getProcessInstanceId(); execution.setVariable("processId", procID); //Get Process Definition Key procKey = execution.getProcessDefinitionKey(); execution.setVariable("processDefinitionKey", procKey); //Get Start Time procStart = execution.getStartTime() execution.setVariable("processInstanceStartTime", procStart); }catch(e){ execution.setVariable("errInit", e.message); }
but the start time keeps coming in NULL, while everything else seems to work. Any ideas on what I am doing wrong?
Labels:
- Labels:
-
Alfresco Process Services
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2020 12:41 AM
Hi,
I think that variable is missing.
You can use alternate way where create process variable and store date as soon as process start and use that variable.
