Task assignment to a particular user

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2009 01:46 AM
Hi
I have created one workflow in which I am initiating the workflow from admin account but i want to assign the next task to a particular user let say 'abc'.can i do this by adding the following lines in the process definition or do i have to add pooled task tag for assigning the task to the specific user.
<swimlane name="assignee">
<assignment actor-id="#{bpm_assignee.properties['cm:abc']}"/>
</swimlane>
Thanks
I have created one workflow in which I am initiating the workflow from admin account but i want to assign the next task to a particular user let say 'abc'.can i do this by adding the following lines in the process definition or do i have to add pooled task tag for assigning the task to the specific user.
<swimlane name="assignee">
<assignment actor-id="#{bpm_assignee.properties['cm:abc']}"/>
</swimlane>
Thanks
Labels:
- Labels:
-
Archive
8 REPLIES 8

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2009 02:31 AM
Simple approach could be following:
To resolve the variable bpm_assignee, at least you have to set a processvariable on workflow-start (or later by an action or something else that has access to the ExecutionContext of JBPM).
Something like this should work:
<task-node name="review"> <task name="wf:reviewTask"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <actor>#{bpm_assignee}</actor> </assignment> </task> …</task-node>
To resolve the variable bpm_assignee, at least you have to set a processvariable on workflow-start (or later by an action or something else that has access to the ExecutionContext of JBPM).
Something like this should work:
Map<QName, Serializable> params = … params.put(WorkflowModel.ASSOC_ASSIGNEE, "thomas"); getWorkflowService().startWorkflow(selectedWorkflow, params);

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2009 03:38 AM
Easiest way, if you want the user whose userName is "abc" to be the swimlane :
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <actor>abc</actor></assignment>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2009 12:25 PM
Hello together,
and what's the way to assign three specific groups to three different swimlanes via java api? Is this possible?
Thanks for helping
Christian
and what's the way to assign three specific groups to three different swimlanes via java api? Is this possible?
Thanks for helping
Christian

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2009 03:26 AM
If you have those swimlanes in your processDefinition.xml :
The following java snippet will set those swimlanes with the suitable groups (for example "GROUP_VALIDATORS", "GROUP_ADMINS", and "GROUP_USERS"):
<swimlane name="Group_1"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <pooledactors>#{var_Group_1}</pooledactors> </assignment> </swimlane><swimlane name="Group_1"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <pooledactors>#{var_Group_3}</pooledactors> </assignment> </swimlane><swimlane name="Group_3"> <assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment"> <pooledactors>#{var_Group_3}</pooledactors> </assignment> </swimlane>
The following java snippet will set those swimlanes with the suitable groups (for example "GROUP_VALIDATORS", "GROUP_ADMINS", and "GROUP_USERS"):
executionContext.setVariable("var_Group_1", "GROUP_VALIDATORS");executionContext.setVariable("var_Group_2", "GROUP_ADMINS");executionContext.setVariable("var_Group_3", "GROUP_USERS");
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2009 06:16 AM
Thanks for helping 
Swimlanes are defined in processdefinition.xml.
I only have one small question: how will i set/get/define the execution context and where?

Swimlanes are defined in processdefinition.xml.
I only have one small question: how will i set/get/define the execution context and where?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2009 07:01 AM
You have 2 solutions :
- call a Java class somewhere in your processDefinition… of course, the Java class setting the swimlane X has to be fired before you enter a task having the swimlane X assigned
- put the snippet into an Alfresco script in your processDefinition… same remark
see Jeff Pott's excellent article
http://ecmarchitect.com/archives/2007/11/19/785
It will illustrate both cases
- call a Java class somewhere in your processDefinition… of course, the Java class setting the swimlane X has to be fired before you enter a task having the swimlane X assigned
- put the snippet into an Alfresco script in your processDefinition… same remark
see Jeff Pott's excellent article
http://ecmarchitect.com/archives/2007/11/19/785
It will illustrate both cases
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2013 04:32 PM
sorry if i bump this thread…but it is possible to do the same thing in Activiti?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2013 12:56 AM
Hi if I understand correctly your requirement then you are trying to call a child workflow from parent workflow right?? For this you can call a java class from your service task. And from this java class you can initiated another workflow. Like this
processEngine.startProcessInstanceByKey("ChildWorkflowProcessId");
and in child workflow you can add n number of assignee groups as per your requirement.
processEngine.startProcessInstanceByKey("ChildWorkflowProcessId");
and in child workflow you can add n number of assignee groups as per your requirement.
