cancel
Showing results for 
Search instead for 
Did you mean: 

Send user tasks to more users.

luisalves00
Champ in-the-making
Champ in-the-making
Hello,

I'm using Activiti on a webapp. Got 1 workflow that something has this:

<userTask id="some_id"
         name="Give Access (${authRequest.numeber} / ${ppItem.pp.name})"
         activiti:candidateUsers="${ppItem.programmers}">
            <extensionElements>
                <activiti:taskListener event="create" class="com.ptsi.gae.bean.activiti.SetPriorityTaskListener">
                    <activiti:field name="priority" stringValue="1" />
                </activiti:taskListener>
            </extensionElements>
            <multiInstanceLoopCharacteristics
            isSequential="false">
                <loopDataInputRef>ppList</loopDataInputRef>
                <inputDataItem name="ppItem" />
            </multiInstanceLoopCharacteristics>
        </userTask>

I don't want to use groups…
What I want to know if is possible…and how…can I add more activiti:candidateUsers="${ppItem.programmers}"
after the task has been send to ${ppItem.programmers}. i.e. id task is not complete yet I want to find it and add more programmers to the list.


best regards,
la00
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
You can use our API:

Task task = taskService.createTaskQuery().processInstanceId("12345").singleResult();
taskService.addCandidateUser(task.getId, "johndoe");

luisalves00
Champ in-the-making
Champ in-the-making
Seems really easy frederikheremans.
The hard task would be finding the right tasks to add the correct candidate users..

tks Smiley Happy

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
yes, it's so easy that with a little effort (looking at the api docs or reading the manual) you could have found it youself 😉

luisalves00
Champ in-the-making
Champ in-the-making
you're right ronald.van.kuijk…I was a bit lazy..sorry.