I am using multi instance call activity. i am using an expression in collection to return order ids of items of a particular product. it runs fine and i see it finishing all the tasks within the call activity. but it fails to complete the call activity. i

cancel
Showing results for 
Search instead for 
Did you mean: 
agnishu
Active Member

I am using multi instance call activity. i am using an expression in collection to return order ids of items of a particular product. it runs fine and i see it finishing all the tasks within the call activity. but it fails to complete the call activity. i

i am using multi instance call activity and using expression in the collection. this returns ids of the orders from a particular item. and based on those ids its supposed to run call activity that many times. 

i tested with one item and all the tasks within the call activity ran for the one order. but when it finished the execution it tried to evaluate the expression again. this time it didnt find any variable that i have defined as input and output already.

<callActivity id="callactivity1" name="IP Allocation MLP" calledElement="MLP">
<extensionElements>
<activiti:in sourceExpression="P0364088" target="MLP_P_CODE"></activiti:in>
<activiti:in source="aibEnvironment" target="aibEnvironment"></activiti:in>
<activiti:in source="thisOrderPID" target="thisOrderPID"></activiti:in>
<activitiSmiley Surprisedut source="aibEnvironment" target="aibEnvironment"></activitiSmiley Surprisedut>
<activitiSmiley Surprisedut source="mop" target="mop"></activitiSmiley Surprisedut>
<activiti:executionListener event="start" class="com.bt.aib.activiti.process.listeners.ActivitiExecutionBoxContextListener"></activiti:executionListener>
<activiti:executionListener event="end" class="com.bt.aib.activiti.process.listeners.ActivitiExecutionUnboxContextListener"></activiti:executionListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${mop.allOrderItemsPIDsFor(&quot;Generic CPE&quotSmiley Wink}" activiti:elementVariable="thisOrderPID"></multiInstanceLoopCharacteristics>
</callActivity>

EndExecutionOperation Error while completing sub process of execution ProcessInstance[213123]
org.activiti.engine.ActivitiException: Error while evaluating expression: ${mop.allOrderItemsPIDsFor("Generic CPE")}

for the first 2 times the expression gave correct output but third time it failed to use the variable "mop"

can you please help?

2 Replies
agnishu
Active Member

Re: I am using multi instance call activity. i am using an expression in collection to return order ids of items of a particular product. it runs fine and i see it finishing all the tasks within the call activity. but it fails to complete the call activit

i am using a service task inside the call activity. this task is completed by leaving the execution by java. and there i am passing all the variables again.

i dont get any problem if i use script task or a service task where i complete the task in the delegate itself.

could it be that the task waits for the response and it nullifies the process variable of the super execution. if thats so how can i prevent it?

should i re-set the variables on the super execution at the start of the call activity.

PS: i get no problem if i use this call activity without multi-instance. but i must use multi instance as i dont know how many instances i might require to run.

agnishu
Active Member

Re: I am using multi instance call activity. i am using an expression in collection to return order ids of items of a particular product. it runs fine and i see it finishing all the tasks within the call activity. but it fails to complete the call activit

The issue got resolved when i re-set the super execution variable at the end of the call activity.

its still puzzles me on why the super execution variable got null and why output parameter doesnt fill it up in case of multi instance call activity.