Hi, I realized a workflow following the tutorial at ecmarchitect. I need to add the possibility to select the user who must approve the document, when the workflow is started.
I think I should modify both platform and share models but I can't understand what I should add, can you help me?
Solved! Go to Solution.
Hello,
In the platform side you need to extend the workflow content model to add a new association with a cmerson to store the approver.
<type name="scwf:submitReviewTask">
<parent>bpm:startTask</parent>
<associations>
<association name="scwf:approver">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:person</class>
<mandatory>true</mandatory>
<many>false</many>
</target>
</association>
</associations>
<mandatory-aspects>
<aspect>scwf:thirdPartyReviewable</aspect>
</mandatory-aspects>
</type>
and must change workflow definition asigning the user selected to the task you want:
activiti:assignee="${scwf_approver.properties.userName}"
In the share side you need to change the start form of workflow to show te selector of the user:
<config evaluator="string-compare" condition="activiti$publishWhitepaper">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="packageItems" />
<show id="scwf:reviewerEmail" />
<show id="scwf:approver" />
<show id="transitions" />
<show id="bpm:status" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="progress" appearance="title" label-id="workflow.set.task.progress" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="packageItems" set="items" />
<field id="scwf:reviewerEmail" set="other" />
<field id="scwf:approver" mandatory="true" set="other" />
<field id="bpm:status" set="progress" />
</appearance>
</form>
</forms>
</config>
Regards
Hello,
In the platform side you need to extend the workflow content model to add a new association with a cmerson to store the approver.
<type name="scwf:submitReviewTask">
<parent>bpm:startTask</parent>
<associations>
<association name="scwf:approver">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:person</class>
<mandatory>true</mandatory>
<many>false</many>
</target>
</association>
</associations>
<mandatory-aspects>
<aspect>scwf:thirdPartyReviewable</aspect>
</mandatory-aspects>
</type>
and must change workflow definition asigning the user selected to the task you want:
activiti:assignee="${scwf_approver.properties.userName}"
In the share side you need to change the start form of workflow to show te selector of the user:
<config evaluator="string-compare" condition="activiti$publishWhitepaper">
<forms>
<form>
<field-visibility>
<show id="bpm:workflowDescription" />
<show id="packageItems" />
<show id="scwf:reviewerEmail" />
<show id="scwf:approver" />
<show id="transitions" />
<show id="bpm:status" />
</field-visibility>
<appearance>
<set id="" appearance="title" label-id="workflow.set.general" />
<set id="items" appearance="title" label-id="workflow.set.items" />
<set id="progress" appearance="title" label-id="workflow.set.task.progress" />
<set id="other" appearance="title" label-id="workflow.set.other" />
<field id="bpm:workflowDescription" label-id="workflow.field.message">
<control template="/org/alfresco/components/form/controls/textarea.ftl">
<control-param name="style">width: 95%</control-param>
</control>
</field>
<field id="packageItems" set="items" />
<field id="scwf:reviewerEmail" set="other" />
<field id="scwf:approver" mandatory="true" set="other" />
<field id="bpm:status" set="progress" />
</appearance>
</form>
</forms>
</config>
Regards
Thanks a lot, that works good. The user selection show all Alfresco users, is it possible to limit it to only a group?
You could develop a custom Form Control for the association:
Form Controls | Alfresco Documentation
Forms reference | Alfresco Documentation
Regards.
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.