<?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 Re: Accessing Process Instance ID inside a ScriptTask in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164114#M117875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect, thanks again for both rapid and informative response! &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; these forums!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As stated execution object is available to the Script Task which provides you will the following;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;execution.getProcessInstanceId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Provides Methods &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String getActivityId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String getId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String getParentId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String getProcessInstanceId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;boolean isEnded()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;boolean isSuspended()&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Feb 2014 12:18:50 GMT</pubDate>
    <dc:creator>gavnunns</dc:creator>
    <dc:date>2014-02-25T12:18:50Z</dc:date>
    <item>
      <title>Accessing Process Instance ID inside a ScriptTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164111#M117872</link>
      <description>Hi,I need to access the process instance id from a groovy script task.According to the docs the script task has access to all process variables, however I'm not clear on if this includes the process instance id or exactly what name I would use to refernce it - http://activiti.org/userguide/index.htm</description>
      <pubDate>Tue, 25 Feb 2014 05:45:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164111#M117872</guid>
      <dc:creator>gavnunns</dc:creator>
      <dc:date>2014-02-25T05:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Process Instance ID inside a ScriptTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164112#M117873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The 'execution' variable should be available. That one should have a getProcessInstanceId() method.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 09:36:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164112#M117873</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2014-02-25T09:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Process Instance ID inside a ScriptTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164113#M117874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gavin, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An implicit object named 'execution' is exposed to the script task. This example: &lt;/SPAN&gt;&lt;A href="https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/test/resources/org/activiti/examples/bpmn/scripttask/ScriptTaskTest.testAutoStoreVariables.bpmn20.xml" rel="nofollow noopener noreferrer"&gt;https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/test/resources/org/activiti/examples/bpmn/scripttask/ScriptTaskTest.testAutoStoreVariables.bpmn20.xml&lt;/A&gt;&lt;SPAN&gt; shows it being used to set a process variable (line 42) and there is a getVariable method too. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;execution is an instance of ExecutionEntity, which I think is intended as internal (at least it does not appear in JavaDoc) but at least you can rely on it implementing &lt;/SPAN&gt;&lt;A href="http://activiti.org/javadocs/org/activiti/engine/delegate/VariableScope.html" rel="nofollow noopener noreferrer"&gt;http://activiti.org/javadocs/org/activiti/engine/delegate/VariableScope.html&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://activiti.org/javadocs/org/activiti/engine/runtime/ProcessInstance.html" rel="nofollow noopener noreferrer"&gt;http://activiti.org/javadocs/org/activiti/engine/runtime/ProcessInstance.html&lt;/A&gt;&lt;SPAN&gt; allowing you access to execution.getProcessInstanceId amongst other things. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was surprised myself that it does not also implement &lt;/SPAN&gt;&lt;A href="http://activiti.org/javadocs/org/activiti/engine/delegate/DelegateExecution.html" rel="nofollow noopener noreferrer"&gt;http://activiti.org/javadocs/org/activiti/engine/delegate/DelegateExecution.html&lt;/A&gt;&lt;SPAN&gt; which is what you have access too when writing Java Service Task implementations (though it does fulfil that contract).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All the best, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tim &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 09:59:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164113#M117874</guid>
      <dc:creator>tstephen</dc:creator>
      <dc:date>2014-02-25T09:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Process Instance ID inside a ScriptTask</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164114#M117875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Perfect, thanks again for both rapid and informative response! &lt;span class="lia-unicode-emoji" title=":red_heart:"&gt;❤️&lt;/span&gt; these forums!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As stated execution object is available to the Script Task which provides you will the following;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;execution.getProcessInstanceId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Provides Methods &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;String getActivityId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String getId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String getParentId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;String getProcessInstanceId()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;boolean isEnded()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;boolean isSuspended()&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2014 12:18:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-process-instance-id-inside-a-scripttask/m-p/164114#M117875</guid>
      <dc:creator>gavnunns</dc:creator>
      <dc:date>2014-02-25T12:18:50Z</dc:date>
    </item>
  </channel>
</rss>

