<?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 Execution variable data type in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/execution-variable-data-type/m-p/252837#M205967</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 developing a complex workflow using Activiti engine. And I'm struggling with execution variables in the Javascript task listener scripts. I could not find what data types execution.setVariable function accepts, but it seems that it accepts only String data types.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a workflow where in one of the middle steps I get multiple assignees, for the next multi instance User Task. I want to store them as an Execution variable, because they will be needed in following tasks. But following code throws an error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;java.lang.ClassCastException: org.alfresco.repo.workflow.activiti.ActivitiScriptNode cannot be cast to java.lang.String&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;userTask id="p_1_3" name="…" activiti:assignee="${wf_responsible}" activiti:formKey="wf:assignCreateResponseTask"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;extensionElements&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:field name="script"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;activiti:string&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; execution.setVariable('wf_assignees', task.getVariable('wf_assignees'));&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;If I put their usernames in an array and join them with commas, later split them for multi instance loop user task. Another error is thrown, that activiti:collection requires data type Collection. And I found no way to cast javascript native array to Collection data type.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I store multiple assignees in a execution variable? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this question relate more to Alfresco or Activiti?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Nov 2012 08:20:00 GMT</pubDate>
    <dc:creator>jurgisl</dc:creator>
    <dc:date>2012-11-26T08:20:00Z</dc:date>
    <item>
      <title>Execution variable data type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/execution-variable-data-type/m-p/252837#M205967</link>
      <description>Hi,I'm developing a complex workflow using Activiti engine. And I'm struggling with execution variables in the Javascript task listener scripts. I could not find what data types execution.setVariable function accepts, but it seems that it accepts only String data types.I have a workflow where in one</description>
      <pubDate>Mon, 26 Nov 2012 08:20:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/execution-variable-data-type/m-p/252837#M205967</guid>
      <dc:creator>jurgisl</dc:creator>
      <dc:date>2012-11-26T08:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Execution variable data type</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/execution-variable-data-type/m-p/252838#M205968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, got it working. All that was needed was to call the .toString() function, like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;execution.setVariable('wf_assignees', task.getVariable('wf_assignees').toString());&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Strange, that it throws an error, complaining that it cannot cast this value to a String, but the object has a standard function to do so. Maybe there are again some Java to Javascript data type mismatches.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 08:31:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/execution-variable-data-type/m-p/252838#M205968</guid>
      <dc:creator>jurgisl</dc:creator>
      <dc:date>2012-11-28T08:31:12Z</dc:date>
    </item>
  </channel>
</rss>

