AnsweredAssumed Answered

multiInstanceLoopCharacteristics and taskVariableValueEquals

Question asked by luisalves00 on Jul 6, 2011
Latest reply on Jul 6, 2011 by luisalves00
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();

Outcomes