Hi everyone,
I have following functionality... There is one workflow which is started on the document and will be assigned to one user group. Any member of that group will claim the task for review purpose. He/She will check the document and its properties (in wf task form) and will do following task..
1) If all the document and properties are upto the mark - Task will be completed and will be sent to the next user in the wf hierarchy.
2) If any of the property is missing or not upto the mark - He/She will assign that task to some other usergroup from wf task form, where member from that newly assigned group will fill properties in the wf task form.
How can I achieve 2nd flow ?
Thanks
Hello,
In the platform side you need to extend the workflow content model of the task in which you want to select the group to add a new association with a cm:authorityContainer to store the approver.
<associations>
<association name="scwf:grouprevisor">
<source>
<mandatory>false</mandatory>
<many>false</many>
</source>
<target>
<class>cm:authorityContainer</class>
<mandatory>true</mandatory>
<many>false</many>
</target>
</association>
</associations>
and must change workflow definition asigning the group selected to the task you want:
<userTask .... activiti:candidateGroups="${scwf_grouprevisor.properties.authorityName}" ... >
...
</userTask>
In the share side you need to change the form for the user task to show the groups selector:
<config evaluator="string-compare" condition="....">
<forms>
<form>
<field-visibility>
...
<show id="scwf:grouprevisor" />
...
</field-visibility>
<appearance>
....
<field id="scwf:grouprevisor" label-id="workflow.field.review_group" set="assignee" />
....
</appearance>
</form>
</forms>
</config>
Regards
Hi Roberto,
I sincerely appreciate your valuable inputs. I am still bit confused as this is something I'm exploring for the very first time. I would like to know what will this do? Basically our requirement is that if something is wrong with the document or properties, new assignee(group) will be selected from the user task form and task will go to that selected assignee(group), otherwise task will be submitted without selecting new assignee(group) and it will go to the next user in the hierarchy. Will it work like this?
Thanks
This configuration let you to select the user group in the review task form. I asume that you have define two custom outcomes that let you chose between the two paths in this point.
To define this in the platform side you need to extend the workflow content model of the task to add the definitión of this outcomes:
<properties>
<property name="scwf:reviseOutcome">
<type>d:text</type>
<default>Ok</default>
<constraints>
<constraint type="LIST">
<parameter name="allowedValues">
<list>
<value>Revise</value>
<value>Ok</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
<property name="bpm:outcomePropertyName">
<default>{http://www.someco.com/model/workflow/1.0}reviseOutcome</default>
</property>
</overrides>
In the workflow definition you must handling this custom outcomes in a listener for the complete event:
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>if(task.getVariableLocal('scwf_reviseOutcome') == 'Revise') {
execution.setVariable('scwf_revise', true);
} else {
execution.setVariable('scwf_revise', false);
}
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
You must copy in an execution variable the outcome to use it in path selection. You can add here a control to ensure that the user group have been selected if you haven't mark it as required. Anyway you need to add to transitions from this task and use the execution variable to decide wich one take:
<sequenceFlow id='flow12' sourceRef='usertask3' targetRef='reviewDecision' />
<exclusiveGateway id="reviewDecision" name="Review Decision" />
<sequenceFlow id="flow13" sourceRef="reviewDecision" targetRef="usertask5">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${scwf_revise == true}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow14" sourceRef="reviewDecision" targetRef="usertask6">
In the share side you need to change the form definition for the user task to show the custom outcomes:
<config evaluator="string-compare" condition="....">
<forms>
<form>
<field-visibility>
...
<show id="scwf:approveRejectOutcome" />
...
</field-visibility>
<appearance>
....
<field id="scwf:approveRejectOutcome" set="response" />
....
</appearance>
</form>
</forms>
</config>
Regards
Thank you so much !
Hi Roberto Gamiz Sanchez
After break I have resumed working on this module. I am able to select group from wf task form but I am unable to assign task to that group.
<userTask id="demoWorkflowTask2" name="Demo Workflow First Task" activiti:candidateGroups="${dr_grouprevisor.properties.authorityName}"
activiti:formKey="dr:demoWorkflowTask2"></userTask>
Above is how I have assigned the task to that selected group.
Below is the screenshot of the error I'm getting.
Can you please help me to fix this issue?
Thanks
Hello, I'm sorry I forgot a little step.
In the task where you choose the group you must to copy in an execution variable the group selected in order to use it later in the workflow:
<extensionElements>
<activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
execution.setVariable('scwf_grouprevisor', task.getVariableLocal('scwf_grouprevisor'));
</activiti:string>
</activiti:field>
</activiti:taskListener>
</extensionElements>
Hello Roberto
Hope you're well. I need to do a workflow of the same nature, please, you can send your files.
Hello yash
I need to do a workflow similar to yours, please share your files. For me to base myself
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.