<?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: Java Service Task Problem with List in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76308#M50303</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did this before and it works to store my list:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class MyJavaService implements JavaDelegate {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void execute(DelegateExecution execution) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; System.out.println("SERVICE");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String[] str_assigneeList = {"kermit", "gonzo", "fozzie"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; execution.setVariable("assigneeList",&amp;nbsp; str_assigneeList);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the problem is that i cannot use this "assigneeList" as a collection in the multi-instance task. Thats the main issue. The following example works when i start a new process instance and i can use the "assigneeList" in my multi-instance task. But i want so set the variables in Java ServiceTask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String[] str_assigneeList = {"kermit", "gonzo", "fozzie"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; List&amp;lt;String&amp;gt; assigneeList = Arrays.asList(str_assigneeList);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("MultiInstanceTask", CollectionUtil.singletonMap("assigneeList", assigneeList));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; System.out.println("Started Process instance id " +processInstance.getProcessInstanceId());&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Nov 2011 13:55:26 GMT</pubDate>
    <dc:creator>smee82</dc:creator>
    <dc:date>2011-11-02T13:55:26Z</dc:date>
    <item>
      <title>Java Service Task Problem with List</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76306#M50301</link>
      <description>Hello,i want to set List of users (productmanagers) as a variable. I want to reuse this variable for a multiinstance task which needs a collection. The collection should contain these users. I tried different possibilities but only get Exception:couldn't instantiate class. Does anybody know how to s</description>
      <pubDate>Wed, 02 Nov 2011 13:06:47 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76306#M50301</guid>
      <dc:creator>smee82</dc:creator>
      <dc:date>2011-11-02T13:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Java Service Task Problem with List</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76307#M50302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think, List is only an interface and thus can't be instantiated. Use ArrayList or something instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 13:40:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76307#M50302</guid>
      <dc:creator>gant</dc:creator>
      <dc:date>2011-11-02T13:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: Java Service Task Problem with List</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76308#M50303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did this before and it works to store my list:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public class MyJavaService implements JavaDelegate {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public void execute(DelegateExecution execution) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; System.out.println("SERVICE");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String[] str_assigneeList = {"kermit", "gonzo", "fozzie"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; execution.setVariable("assigneeList",&amp;nbsp; str_assigneeList);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; } &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the problem is that i cannot use this "assigneeList" as a collection in the multi-instance task. Thats the main issue. The following example works when i start a new process instance and i can use the "assigneeList" in my multi-instance task. But i want so set the variables in Java ServiceTask.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; String[] str_assigneeList = {"kermit", "gonzo", "fozzie"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; List&amp;lt;String&amp;gt; assigneeList = Arrays.asList(str_assigneeList);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("MultiInstanceTask", CollectionUtil.singletonMap("assigneeList", assigneeList));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; System.out.println("Started Process instance id " +processInstance.getProcessInstanceId());&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 13:55:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76308#M50303</guid>
      <dc:creator>smee82</dc:creator>
      <dc:date>2011-11-02T13:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Java Service Task Problem with List</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76309#M50304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;String[] str_productmanagerList = {"prod_man_1", "prod_man_2"};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Collection&amp;lt;String&amp;gt; productmanagerList = Arrays.asList(str_productmanagerList);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;execution.setVariable("productmanagerList",&amp;nbsp; productmanagerList);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I finally got it. It works with Collection.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 15:17:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-service-task-problem-with-list/m-p/76309#M50304</guid>
      <dc:creator>smee82</dc:creator>
      <dc:date>2011-11-02T15:17:22Z</dc:date>
    </item>
  </channel>
</rss>

