cancel
Showing results for 
Search instead for 
Did you mean: 

Worfkflow: select Assignee from list

ajejebrazorf
Champ in-the-making
Champ in-the-making

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?

1 ACCEPTED ANSWER

roberto_gamiz
Star Contributor
Star Contributor

Hello,

In the platform side you need to extend the workflow content model to add a new association with a cmSmiley Tongueerson 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

View answer in original post

3 REPLIES 3

roberto_gamiz
Star Contributor
Star Contributor

Hello,

In the platform side you need to extend the workflow content model to add a new association with a cmSmiley Tongueerson 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?