<?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 NullPointerException in ExecutionEntity in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28243#M14282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to display a list of running process instances in my UI, and here's what I did:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Called runtimeService.createProcessInstanceQuery().list();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For each of them &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; called repositoryService.findProcessDefinitionById(processInstance.getProcessDefinitionId()) to get the definition name.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; called processInstance.findActiveActivityIds()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the last line, I get an exception as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Caused by: java.lang.NullPointerException&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.engine.impl.runtime.ExecutionEntity.ensureProcessDefinitionInitialized(ExecutionEntity.java:195)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.pvm.impl.runtime.ExecutionImpl.getProcessDefinition(ExecutionImpl.java:296)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.engine.impl.runtime.ExecutionEntity.ensureActivityInitialized(ExecutionEntity.java:235)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.pvm.impl.runtime.ExecutionImpl.collectActiveActivityIds(ExecutionImpl.java:274)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;at org.activiti.pvm.impl.runtime.ExecutionImpl.findActiveActivityIds(ExecutionImpl.java:269)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;…&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note: this was the first thing requested from the engine when the process is run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By looking at the code, I guess this happens when the process definition is loaded in a way that doesn't parse the process definition. When we call findActiveActivityIds it tries to load and parse the definition too. I guess (I'm not sure) that CommandContext.getCurrent() is returning null when called in this context.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I add this to JIRA?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And is there a better way to do what I was doing originally?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Sep 2010 08:10:05 GMT</pubDate>
    <dc:creator>iravanchi</dc:creator>
    <dc:date>2010-09-29T08:10:05Z</dc:date>
    <item>
      <title>NullPointerException in ExecutionEntity</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28243#M14282</link>
      <description>Hi,I want to display a list of running process instances in my UI, and here's what I did:Called runtimeService.createProcessInstanceQuery().list();For each of them {&amp;nbsp;&amp;nbsp;&amp;nbsp; called repositoryService.findProcessDefinitionById(processInstance.getProcessDefinitionId()) to get the definition name.&amp;nbsp;&amp;nbsp;&amp;nbsp; called</description>
      <pubDate>Wed, 29 Sep 2010 08:10:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28243#M14282</guid>
      <dc:creator>iravanchi</dc:creator>
      <dc:date>2010-09-29T08:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException in ExecutionEntity</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28244#M14283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Congrats, you have found a bug &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, the findActiveActivityIds() should be removed from the ProcessInstance and you should use the getActiveActivityIds() on the runtimeService instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have removed the operation from the ProcessInstance interface.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Sep 2010 08:39:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28244#M14283</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2010-09-29T08:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException in ExecutionEntity</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28245#M14284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, in general, should I report such issues in JIRA?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't seen any clear guideline on when to report bugs on JIRA.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I already have an account, but I'm not sure when to use it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Sep 2010 10:37:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28245#M14284</guid>
      <dc:creator>iravanchi</dc:creator>
      <dc:date>2010-09-29T10:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: NullPointerException in ExecutionEntity</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28246#M14285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, if you find such a bug, please put it in Jira. So the guideline is: if something is not as you expect it, report it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even if it is not a real bug, we learn how end users are using Activiti.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Oct 2010 09:14:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/nullpointerexception-in-executionentity/m-p/28246#M14285</guid>
      <dc:creator>jbarrez</dc:creator>
      <dc:date>2010-10-01T09:14:13Z</dc:date>
    </item>
  </channel>
</rss>

