cancel
Showing results for 
Search instead for 
Did you mean: 

multiInstanceLoopCharacteristics and taskVariableValueEquals

luisalves00
Champ in-the-making
Champ in-the-making
I got some tasks with multiInstanceLoopCharacteristics that I want to query with taskVariableValueEquals( … ).

<multiInstanceLoopCharacteristics isSequential="false">
   <loopDataInputRef>ppList</loopDataInputRef>
   <inputDataItem name="ppItem" />
</multiInstanceLoopCharacteristics>

Is it possibel to do something like:

List<Task> tasks = getActivitiEngine().getTaskService().createTaskQuery().taskVariableValueEquals("ppItem.pp.id", pp.getId()).list();

(return 0 results…)

or I can't "navigate" a custom object? On the task name I can do ${ppItem.pp.name}

if not how can I do what I want?

Idea:

<activiti:taskListener event="create" class="org.me.gae.bean.activiti.SetPPIdTaskListener" />

public class SetPostoProgramacaoIdTaskListener  implements TaskListener {

    public void notify(DelegateTask dt) {
        PPTaskModel ppModel = (PPTaskModel)dt.getVariable("ppItem");
        dt.setVariableLocal("ppId", String.valueOf(ppModel.getPp().getId()));
    }

the variable is set….but the query return 0 results:

List<Task> tasks = getActivitiEngine().getTaskService().createTaskQuery().taskVariableValueEquals("ppId", String.valueOf(pp.getId())).list();
1 REPLY 1

luisalves00
Champ in-the-making
Champ in-the-making
Solved.

it works, but the variables have to be the same type (http://forums.activiti.org/en/viewtopic.php?f=6&t=1509&p=6364&hilit=taskVariableValueEquals#p6364), in my case String.