<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to access process Instance start time in a script task? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-process-instance-start-time-in-a-script-task/m-p/39554#M16616</link>
    <description>&lt;P&gt;Hi, I'm trying to access a process instance start time within a script task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Written in Javascript, I currently have&lt;/P&gt;&lt;PRE&gt;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);
}&lt;/PRE&gt;&lt;P&gt;but the start time keeps coming in NULL, while everything else seems to work.&amp;nbsp; Any ideas on what I am doing wrong?&lt;/P&gt;</description>
    <pubDate>Mon, 11 May 2020 14:49:17 GMT</pubDate>
    <dc:creator>cchung</dc:creator>
    <dc:date>2020-05-11T14:49:17Z</dc:date>
    <item>
      <title>How to access process Instance start time in a script task?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-process-instance-start-time-in-a-script-task/m-p/39554#M16616</link>
      <description>&lt;P&gt;Hi, I'm trying to access a process instance start time within a script task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Written in Javascript, I currently have&lt;/P&gt;&lt;PRE&gt;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);
}&lt;/PRE&gt;&lt;P&gt;but the start time keeps coming in NULL, while everything else seems to work.&amp;nbsp; Any ideas on what I am doing wrong?&lt;/P&gt;</description>
      <pubDate>Mon, 11 May 2020 14:49:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-process-instance-start-time-in-a-script-task/m-p/39554#M16616</guid>
      <dc:creator>cchung</dc:creator>
      <dc:date>2020-05-11T14:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to access process Instance start time in a script task?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-access-process-instance-start-time-in-a-script-task/m-p/39555#M16617</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I think that variable is missing.&lt;/P&gt;&lt;P&gt;You can use alternate way where create process variable and store date as soon as process start and use that variable.&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2020 04:41:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-access-process-instance-start-time-in-a-script-task/m-p/39555#M16617</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-05-19T04:41:30Z</dc:date>
    </item>
  </channel>
</rss>

