ERROR - Passed value is not an instance of ActivitiScriptNode!

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2016 07:28 AM
Hello,
I have a little bit of problem - I need to automate a process by using document name (all required info will be in the document title).
Ex. ID_PRICE_GROUP.pdf
So I get the info of the document like this:
The next step is to set all the info where I need it - the group that needs to receive the document. So I get the group from the array like this:
But I get the error that Passed value is not an instance of ActivitiScriptNode, cannot set value.
In the content model I have association:
Can somebody help me with this? I am stuck
.
Maybe I can transform it somehow, or get and set the group some other way?
Thank you in advance,
Irena
I have a little bit of problem - I need to automate a process by using document name (all required info will be in the document title).
Ex. ID_PRICE_GROUP.pdf
So I get the info of the document like this:
<startEvent id="startevent1" name="Start" activiti:formKey="swf:submitProcess"> <extensionElements> <activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener"> <activiti:field name="script"> <activiti:string><![CDATA[ var docSubject = bpm_package.children[0].properties["cm:name"]; var docSubjectArray = docSubject.split("_"); // AT THIS POINT I HAVE AN ARRAY WITH ALL THE INFO I NEED LIKE WHAT GROUP TO BE SENT TO ETC. ]]></activiti:string> </activiti:field> </activiti:executionListener> </extensionElements> </startEvent>
The next step is to set all the info where I need it - the group that needs to receive the document. So I get the group from the array like this:
var gr = docSubjectArray[3]; var g = groups.getGroup("GROUP_"+gr); //logger.log("\n\n\n GROUP NODE = " + g.groupNode); execution.setVariable('swf_group',g.groupNode); //maybe even like this logger.log("\n\n\n GROUP NODE REF = " + g.groupNodeRef); //var kk = search.findNode(g.groupNodeRef); //logger.log("\n\n\n KK = "+ kk);
But I get the error that Passed value is not an instance of ActivitiScriptNode, cannot set value.
In the content model I have association:
<aspect name="swf:group"> <associations> <association name="swf:group"> <source> <mandatory>false</mandatory> <many>false</many> </source> <target> <class>cm:authorityContainer</class> <mandatory>false</mandatory> <many>false</many> </target> </association> </associations> </aspect>
Can somebody help me with this? I am stuck

Maybe I can transform it somehow, or get and set the group some other way?
Thank you in advance,
Irena
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2016 08:40 AM
SOLVED ! - I made small changes in the code - instead of sending the whole group (error: can not serialize value in variable) I am setting the
value of variable (ex. myGroup -> execution.setVariable('myGroup', g.getGroupNode().properties.authorityName )) with the Authority Name.
And changed the variable I use in the task
-> instead of
<code> activiti:candidateGroups="${swf_group.properties.authorityName}"
</code>
-> I use
<code>activiti:candidateGroups="${myGroup}".
</code>
value of variable (ex. myGroup -> execution.setVariable('myGroup', g.getGroupNode().properties.authorityName )) with the Authority Name.
And changed the variable I use in the task
-> instead of
<code> activiti:candidateGroups="${swf_group.properties.authorityName}"
</code>
-> I use
<code>activiti:candidateGroups="${myGroup}".
</code>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2016 10:11 AM
Thanks for posting back your solution.
