cancel
Showing results for 
Search instead for 
Did you mean: 

How can a multi-instance task read the inputDataItem?

wolpert
Champ in-the-making
Champ in-the-making
I have the following xml fragment in my business process…

    <callActivity id="digitizeVideo" name="DigitizeVideo" calledElement="SourceVideo">
      <multiInstanceLoopCharacteristics isSequential="false">
        <loopDataInputRef>assetsToDigitize</loopDataInputRef>
        <inputDataItem name="assetId"></inputDataItem>
      </multiInstanceLoopCharacteristics>
    </callActivity>

When the call activity is executed, I get a bunch of new processes running. The first task is being worked on needs the assetId in this case. How is it set? Specifically, I see the initial process instance which has the assetsToDigitize variable set, which has executions. One of those executions have the assetId set. It also has 5 subProcessInstances which do not have the variable set, and the task does not have the variable set. As far as I can tell, given a taskId, I can't 'find' the assetId its supposed to work on.

So, my question is; what is the proper way to find the variable set via the multiInstanceLoopCharacteristics behavior when I only have the taskId available to me?
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi,

Hmm interesting. Did you look at the possibility to pass a process variable to the sub process using an in parameter on the call activity?
So like:

<extensionElements>
  <activiti:in source="assetsToDigitize" target="assetId" />
</extensionElements>

Best regards,

wolpert
Champ in-the-making
Champ in-the-making
My example isn't much different then the miParallelUserTasksBasedOnCollection test case… which is this:

  <multiInstanceLoopCharacteristics isSequential="false">
        <loopDataInputRef>assigneeList</loopDataInputRef>
        <inputDataItem name="assignee" />
        <completionCondition>${nrOfCompletedInstances/nrOfInstances >= 0.6 }</completionCondition>
      </multiInstanceLoopCharacteristics>

In my case, it makes everything correct, and I see a variable in the database attached to an execution, but if I only have the task object itself, how can I access the variable set by the 'multiInstanceLoopCharacteristics'? I've tried task variables and variablesLocal, process instance variables and variablesLocal, and every other combination. I can try that other technique but is it doing anything different? From looking at the source code, I'm not sure it is.

wolpert
Champ in-the-making
Champ in-the-making
I'm trying the 'in' technique now. Though it seems that the variable should automatically be set, I'll see if this will work.

wolpert
Champ in-the-making
Champ in-the-making
It did work by using the activiti:in, but I had to use this format:

      <extensionElements>
        <activiti:in source="assetId" target="assetId"></activiti:in>
      </extensionElements>

I have no need to use activitiSmiley Surprisedut in my case. I'm not sure I understand why this isn't default behavior of activiti, but I am happy I have a technique that works and supported by the eclipse designer.

Thanks.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.