<?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 Getting a Process Instance name from Script in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/getting-a-process-instance-name-from-script/m-p/22418#M9815</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to update the process instance name based on the current name using a Script. I thought something like below. But I don't know how to get the processInstance object from the execution. Any advice?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;currentProcessName = processInstance.getName();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;switch (currentProcessName) {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;case "ABC":&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId(),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"New ABC"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;break;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;case "CDE":&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId(),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Something else CDE"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;break;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 26 Apr 2021 17:27:50 GMT</pubDate>
    <dc:creator>jose_leon_coupa</dc:creator>
    <dc:date>2021-04-26T17:27:50Z</dc:date>
    <item>
      <title>Getting a Process Instance name from Script</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/getting-a-process-instance-name-from-script/m-p/22418#M9815</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I need to update the process instance name based on the current name using a Script. I thought something like below. But I don't know how to get the processInstance object from the execution. Any advice?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;currentProcessName = processInstance.getName();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;switch (currentProcessName) {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;case "ABC":&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId(),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"New ABC"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;break;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;case "CDE":&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;execution.getEngineServices().getRuntimeService().setProcessInstanceName(execution.getProcessInstanceId(),&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"Something else CDE"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;break;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="courier new,courier" size="2"&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 26 Apr 2021 17:27:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/getting-a-process-instance-name-from-script/m-p/22418#M9815</guid>
      <dc:creator>jose_leon_coupa</dc:creator>
      <dc:date>2021-04-26T17:27:50Z</dc:date>
    </item>
  </channel>
</rss>

