- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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?
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 05:26 AM
Thank you very much, now it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 01:48 PM
Did your share-config-custom contain an task-type entry that corresponds to the content type "psw:activitiCreaCSSemplice"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 05:02 AM
No, I didn't, I'm doing it now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 05:06 AM
Few points
- I do not see any out going flow from your first user task.
- In none of your task forms you have added bpm:assignee. In order to use it you have to include it as part of your tasks in workflow model and need to include it in form for task where you want it to be selected.
- For using group assignment you will have to use bpm_groupAssignee
Hope this helps you to figure out your issue.
