10-20-2016 10:22 AM
My workflow doesn't get first group assignment and also it gives me an error using bpm:assignee
Any advice?
10-21-2016 05:03 AM
The first option. The second does not do anything at all - the "var" is immediately being lost when the script context is exited.
10-20-2016 01:45 PM
In your case the bpm_assignee cannot be resolved because you have not passed on the data from the task where the user sets if (creaCSS user task) so that the other task (valutaCSS) can used. Data is not automatically transferred from a task to the workflow and you must define task listeners to copy the data you need. You have done so already for psw_esitoValutazioneCS in the second task but must also do this for bpm_assignee in the first.
10-21-2016 05:00 AM
Ok, so I need something like this in my "creaCSS" task?
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.taskListener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
<![CDATA[execution.setVariable('bpm_assignee', task.getVariableLocal('bpm_assignee'))]]>
</activiti:string>
</activiti:field>
</activiti:taskListener>
Or I need another variable like this:
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.taskListener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
<![CDATA[var assegnatario = task.getVariableLocal('bpm_assignee')]]>
</activiti:string>
</activiti:field>
</activiti:taskListener>
And then I have to pass "assegnatario" to "valutaCSS", so something like
<userTask id="valutaCSS" name="Valuta Certificato di Servizio (semplice)" activiti:formKey="psw:activitiValutaCS">
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string><![CDATA[if(task.getVariableLocal('psw_esitoValutazioneCS') == 'Approvato'){
execution.setVariable('psw_prosegui', true);
}else{
execution.setVariable('psw_prosegui', false);
}]]></activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
<humanPerformer>
<resourceAssignmentExpression>
<formalExpression>${assegnatario.properties.userName}</formalExpression>
</resourceAssignmentExpression>
</humanPerformer>
</userTask>
10-21-2016 05:03 AM
The first option. The second does not do anything at all - the "var" is immediately being lost when the script context is exited.
10-21-2016 05:26 AM
Thank you very much, now it works
10-20-2016 01:48 PM
Did your share-config-custom contain an task-type entry that corresponds to the content type "psw:activitiCreaCSSemplice"?
10-21-2016 05:02 AM
No, I didn't, I'm doing it now
10-21-2016 05:06 AM
Few points
Hope this helps you to figure out your issue.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.