cancel
Showing results for 
Search instead for 
Did you mean: 

custom workflow with multiple assignees

vincent-kali
Star Contributor
Star Contributor
Hi,
I'm trying to create a custom workflow in order to approve a document in 3 steps.
I want the initiator to select the 3 groupes that will be assigned to each steps.
My problem: I'm unable to render the appropriate control on the start task form.
(no group assignee control appear)

Extract of bpmn file:

<process id="demo" name="3 steps Review And Approve Process" isExecutable="true"> 
<startEvent id="start" activiti:formKey="mymodel:myStartTask"></startEvent>



Model file:

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="mymodel:workflowmodel"
      xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Imports are required to allow references to definitions in other models –>
   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/bpm/1.0" prefix="bpm" />
      <import uri="http://www.alfresco.org/model/workflow/1.0" prefix="wf"/>
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="demo.worflow"
            prefix="mymodel" />
   </namespaces>   
<types>
   <type name="mymodel:myStartTask">
      <parent>wf:submitConcurrentReviewTask</parent>
      <mandatory-aspects>
         <aspect>mymodel:groupAssigneeStep1</aspect>
         <aspect>mymodel:assigneeStep2</aspect>
         <aspect>mymodel:groupAssigneeStep3</aspect>
      </mandatory-aspects>
   </type>
</types>
<aspects>
   <aspect name="mymodel:groupAssigneeStep1">
      <parent>bpm:groupAssignee</parent>
   </aspect>
   <aspect name="mymodel:assigneeStep2">
      <parent>bpm:assignee</parent>
   </aspect>
   <aspect name="mymodel:groupAssigneeStep3">
      <parent>bpm:groupAssignee</parent>
   </aspect>
</aspects>

</model>


SURF config file:


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<alfresco-configuration>

   <config evaluator="string-compare" condition="activiti$demo">
      <forms>
         <form>
            <field-visibility>
               <show id="bpm:workflowDescription" />
               <show id="bpm:workflowDueDate" />
               <show id="bpm:workflowPriority" />
            <show id="mymodel:groupAssigneeStep1" />
            <show id="mymodel:assigneeStep2" />
            <show id="mymodel:groupAssigneeStep3" />
               <show id="packageItems" />
               <show id="bpm:sendEMailNotifications" />
            </field-visibility>
            <appearance>
               <set id="" appearance="title" label-id="workflow.set.general" />
               <set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
               <set id="assignee" appearance="title" label-id="workflow.set.assignee" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
               <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="bpm:workflowDueDate" label-id="workflow.field.due" set="info">
                  <control template="/org/alfresco/components/form/controls/date.ftl">
                      <control-param name="showTime">false</control-param>
                      <control-param name="submitTime">false</control-param>
                  </control>
               </field>
               <field id="bpm:workflowPriority" label-id="workflow.field.priority" set="info">
                  <control template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
               </field>
            <field id="mymodel:groupAssigneeStep1" label-id="workflow.field.review_group" set="assignee" />
            <field id="mymodel:assigneeStep2" label-id="workflow.field.review_group" set="assignee" />
            <field id="mymodel:groupAssigneeStep3" label-id="workflow.field.review_group" set="assignee" />
              
            <field id="wf:requiredApprovePercent" label-id="workflow.field.requiredApprovePercent" set="assignee">
                  <control template="/org/alfresco/components/form/controls/percentage-approve.ftl">
                     <control-param name="minValue">1</control-param>
                     <control-param name="maxValue">100</control-param>
                  </control>
               </field>
               <field id="packageItems" set="items" />
               <field id="bpm:sendEMailNotifications" set="other">
                  <control template="/org/alfresco/components/form/controls/workflow/email-notification.ftl" />
               </field>
            </appearance>
         </form>
      </forms>
   </config>

</alfresco-configuration>


Any advice ?
Thanks



3 REPLIES 3

vincent-kali
Star Contributor
Star Contributor
I finally found the solution: use force="true" in SURF config file….



<show id="mymodel:groupAssigneeStep1" force="true" />


Documentation says: The force attribute ensures that the NodeFormProcessor searches the entire Alfresco content model for the property or association definition before returning anything.
It's totally unclear for me…. Does it means that when force attribute is not used, NodeFormProcessor searched the content model, but partially only ?

Regards,

jithin
Champ in-the-making
Champ in-the-making
Vincent-Kali
Where to place this 3 edited files in alfresco?

vincent-kali
Star Contributor
Star Contributor
Hi JIN
I advise you to read this article
http://ecmarchitect.com/alfresco-developer-series-tutorials/workflow/tutorial/tutorial.html

Workflow deployment is greatly explained.

Vincent