cancel
Showing results for 
Search instead for 
Did you mean: 

Task assignment based on an attribute value

kerkira67
Champ in-the-making
Champ in-the-making
Hi,

I have designed a workflow with several task nodes. Each task needs to be assigned to a different person based on the value of a particular attribute, defined in the startTask.

I imagine that this can be done using scripts, but I do not know exactly how.

I think I can define an association for each role in the workflow and perform swimlane assignments using these associations. What I need to know is how to assign a particular user to a particular association, based on an attribute value specified by the initiator.

Can you please help me?

Thanks

Roberto
3 REPLIES 3

davidc
Star Contributor
Star Contributor
For each person you want to choose in your start task define an association (to cmSmiley Tongueerson) in your start task definition.  Each association is given a name e.g. ex:user1, ex:user2.

Then in swimlane and task assignments you can use:

<swimlane name="assignee">
  <assignment actor-id="#{ex_user1.properties['cm:userName']}"/>
</swimlane>

or in v2.0:

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

kerkira67
Champ in-the-making
Champ in-the-making
Hi,

I did not explain well the point. The assignment should be performed on an attribute which does not indicate the person. I'll try to explain the scenario.

The application is used to send documents which contain formal software change requests. Obviously, this is not a bug tracking system, but a system which manages formal requests which go from an office to another (the IT office) whithin the same Public Administration. There are different project groups, which do the maintenance of different applications. The initiator should choose the group in the start task. Based on his choice, the workflow description should perform swimlane assigment to different persons.

Let's make an example. The user selects the group which does the maintenance of the financial accounting system. The wokflow engine should know that, in that particular group, user A does the analysis, user B does the design/development and so forth.
Suppose that another user starts another workflow instance, selecting the group which does the maintenance of the Human Resource Management System. In that case user C does the analysis, user D does the design/development, etc..
In any case, the workflow engine should always persorm swimlane assignment correctly based only on the name of the group, which is an attribute of the start task.


Thanks
Roberto

davidc
Star Contributor
Star Contributor
Hi Roberto,

Thanks for the clarification.

However, I must be missing something as I don't understand how the workflow engine will ever know that a particular user in a group must be assigned to a particular swimlane.  That information must be specified somewhere (or perhaps it's implied in the order of the people in the group).

How are you intending to provide the mapping?