cancel
Showing results for 
Search instead for 
Did you mean: 

How can i assign a workflow to multiple assignees ?

zengqingyi12
Champ in-the-making
Champ in-the-making
I have tried to assign a workflow to multiple assignees, and it is successful in Alfresco Explorer, but when i want to do this in alfresco share, it failed.
I have change the singleSelectMode in workflow.js to false, and it can select multiple assignees, but when i click "assign workflow" button, it returns a alert:"can not assign workflow".   What can i do to figure out this?
thanks in advance ~~~~~~~
4 REPLIES 4

jpfi
Champ in-the-making
Champ in-the-making
Hi,
as far as I know the Repository WebScript used by Share's workflow dialog don't support multiple user assignments for the moment.
So, you'll also have to change these Repo WebScripts.
Cheers, jan

zengqingyi12
Champ in-the-making
Champ in-the-making
I have changed the web script :
   // Get the workflow definition
   var workflowDefinition = workflow.getDefinitionByName(workflowName);

   // Create the workflow package to contain the file nodes
   var workflowPackage = workflow.createPackage();

   if (assignees.length == 1)
   {
      workflowParameters["bpm:assignee"] = assignees[0];
   }
   else
   {
      workflowParameters["bpm:assignees"] = assignees;
   }

   var workflowPath = workflowDefinition.startWorkflow(workflowPackage, workflowParameters);

//process define

   <start-state name="start">
      <task name="wf:submitAdhocTask" swimlane="initiator"/>
      <transition name="" to="adhoc"/>
   </start-state>

//model define
      <type name="wf:submitAdhocTask">
         <parent>bpm:startTask</parent>
         <properties>
            <property name="wf:notifyMe">
               <type>d:boolean</type>
               <default>false</default>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>bpm:assignees</aspect>//I have changed it to accept multiple assignees
         </mandatory-aspects>
      </type>

But when i run this webscript , it still can not assign workflow to multiple user.

By the way, is there any method to debug alfresco web script , or maybe set a break point ?

jpfi
Champ in-the-making
Champ in-the-making
hi,
there is a javascript debugger: http://localhost:8080/alfresco/service/api/javascript/debugger for repository tier
& http://localhost:8080/share/service/api/javascript/debugger for presentation/Share tier.
cheers, jan

zengqingyi12
Champ in-the-making
Champ in-the-making
Thank you very much. someone can help me to write a web script that can assign multiple assignees ?