<?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 Java backed webscript, retrieving package items by task id throws null pointer exception in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-webscript-retrieving-package-items-by-task-id-throws/m-p/280027#M233157</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'm looping through completed workflows. I do tasks search retrieving all the tasks of the workflow instance. I parse the tasks and then try to search all the package items of the task and I get null noderef exception. I can see the nodeRef in log and I have tried to find the node using node browser and it looks like the node doesn't exist. Why does the workflowservice try to search a node that doesn't exist?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;List&amp;lt;WorkflowInstance&amp;gt; instances = this.workflowService.getCompletedWorkflows();&lt;BR /&gt;for (WorkflowInstance instance : instances) {&lt;BR /&gt;&amp;nbsp; WorkflowTaskQuery query = new WorkflowTaskQuery();&lt;BR /&gt;&amp;nbsp; query.setActive(false);&lt;BR /&gt;&amp;nbsp; query.setTaskState(null);&lt;BR /&gt;&amp;nbsp; query.setProcessId(instance.getId());&lt;BR /&gt;&amp;nbsp; List&amp;lt;WorkflowTask&amp;gt; tasks = workflowService.queryAllTasks(query);&lt;BR /&gt;&amp;nbsp; WorkflowTask endTask = getEndTask(tasks); // I needed to my own parsing here because when I tried to do the query with custom properties I always got empty list&lt;BR /&gt;&amp;nbsp; if (endTask != null) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;NodeRef&amp;gt; items = this.workflowService.getPackageContents(endTask.getId()); // HERE THE ERROR OCCURS!!!&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; …&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 May 2015 09:10:42 GMT</pubDate>
    <dc:creator>sihnu</dc:creator>
    <dc:date>2015-05-22T09:10:42Z</dc:date>
    <item>
      <title>Java backed webscript, retrieving package items by task id throws null pointer exception</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-webscript-retrieving-package-items-by-task-id-throws/m-p/280027#M233157</link>
      <description>Hi,I'm looping through completed workflows. I do tasks search retrieving all the tasks of the workflow instance. I parse the tasks and then try to search all the package items of the task and I get null noderef exception. I can see the nodeRef in log and I have tried to find the node using node brow</description>
      <pubDate>Fri, 22 May 2015 09:10:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-backed-webscript-retrieving-package-items-by-task-id-throws/m-p/280027#M233157</guid>
      <dc:creator>sihnu</dc:creator>
      <dc:date>2015-05-22T09:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Java backed webscript, retrieving package items by task id throws null pointer exception</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-backed-webscript-retrieving-package-items-by-task-id-throws/m-p/280028#M233158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could it be that workflow service is trying to retrieve nodes that have been deleted from the repository and once belonged to the workflow? That means they are not synced correctly if they are synced at all.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 May 2015 09:44:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-backed-webscript-retrieving-package-items-by-task-id-throws/m-p/280028#M233158</guid>
      <dc:creator>sihnu</dc:creator>
      <dc:date>2015-05-22T09:44:12Z</dc:date>
    </item>
  </channel>
</rss>

