cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Workflow Task Asignation

ljyanes
Champ in-the-making
Champ in-the-making
Is it possible to assign people to a Workflow after the <start-state> node? If it is, how could it be done?
3 REPLIES 3

jarrett
Champ in-the-making
Champ in-the-making
Yes,

To assign someone to a workflow through the workflow I've done something like this:

In a task, write a script similar to this:

            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>
                  <expression>
                     var currentUser = (person.properties["userName"]);
                  wf_NextParticipant = currentUser;            
                  </expression>
                  <variable name="wf_NextParticipant" access="read,write"/>
               </script>
         </action>
All that is doing is setting the name of the current user to a variable. You could do the same with a property.

Then when you want to assign the a task to that person, you could do so like this:

<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
    <actor>#{people.getPerson(NextParticipant).properties["cm:userName"]}</actor>
</assignment>

Not really sure if that's what you're looking for but hope it helps.

ljyanes
Champ in-the-making
Champ in-the-making
Yes, that's what I was looking for, now what could it be done on the interface of the workflow so that it lists the Users and/or groups the task will be assigned to?

jarrett
Champ in-the-making
Champ in-the-making
To make sure I am following you, you're looking for away to make a drop down of users in a task, so someone can assign tasks?