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.pdfSo 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