cancel
Showing results for 
Search instead for 
Did you mean: 

assign the workflow to a specific person

roseta
Champ in-the-making
Champ in-the-making
I would like to know the expresion to assign a task in a workflow to a specific person. For a specific group we have this:

<swimlane name="reviewer">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <pooledactors>#{people.getGroup('GROUP_HR')}</pooledactors>
        </assignment>   
</swimlane>


Then we have this to choose a person:

<swimlane name="reviewer">
        <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
            <actor>#{bpm_assignee}</actor>   
        </assignment>   
    </swimlane>

But for a specific person called mike? Does anyone know how to do it???
7 REPLIES 7

evan
Champ in-the-making
Champ in-the-making
I have same problem with you  and  hoping some body can ask this question. thanks.

sebp
Champ in-the-making
Champ in-the-making
Maybe this?:

<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{people.getPerson("mike")}</actor>
</assignment>
</swimlane>

Or in the task before Mike's task you can do an assignment with


            <event type="task-assign">
                <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
                    <runas>admin</runas>
                    <script>
                        <expression>
                            bpm_assignee = people.getPerson("mike");
                            bpm_assignee;
                        </expression>
                        <variable name="bpm_assignee" access="read,write" />
                    </script>
                </action>
            </event>

roseta
Champ in-the-making
Champ in-the-making
I've tried it and both don't work… Actually, the group code I put doesn't work either… everthing goes with no erros, but when I run the workflow, it doesn't assign to anybody…

ANY MORE IDEAS, PLEAS?????

abhashree
Champ in-the-making
Champ in-the-making
hi
i think in place of {people.getPerson("mike")} use {people.getUser("mike")}
this may help you.

piousbox
Champ in-the-making
Champ in-the-making
In the workflow console try


use <YOUR WORKFLOW>
var bpm_assignee* person mike
start

or something like that… this may be of help: http://wiki.alfresco.com/wiki/Workflow_Console

cjimenez2581
Champ in-the-making
Champ in-the-making
Im trying to use people.getPerson but its not working… take a look


<userTask id="tarea1" name="Tarea Revisar" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="ak:tareaRevisar">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
                if (typeof bpm_workflowDueDate != 'undefined') task.setVariableLocal('bpm_dueDate', bpm_workflowDueDate);
                if (typeof bpm_workflowPriority != 'undefined') task.priority = bpm_workflowPriority;
           </activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="complete" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
                execution.setVariable('ak_reviewOutcome', task.getVariable('ak_reviewOutcome'));
                execution.setVariable('ak_wf_publicador', people.getPerson('admin'));
                </activiti:string>
          </activiti:field>
        </activiti:taskListener>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>
                execution.setVariable('ak_mail1', initiator.properties.email);
                execution.setVariable('ak_mail2', bpm_assignee.properties.email);
</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
    </userTask>

vinaxwater
Champ in-the-making
Champ in-the-making
Dear,
This code is working for me:

<task name="wf:approvedStaffBD">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<pooledactors>vinax</pooledactors>
</assignment>
</task>

You can view class AlfrescoAssignment.java for customize method with your requirement.
Thanks and Regards.