AnsweredAssumed Answered

Service task: result variable name is lost on export

Question asked by kuehly on Jun 7, 2013
Latest reply on Jun 11, 2013 by kuehly
I'm playing around with service tasks and stumbled over the following issue. I reproduced it with a super simple process. I create a process in the Activiti Modeler with a service task. I set the attribute "Result variable name" to "testVar":
Then I save the model and export it to a file. Result: the definition of the result variable is missing from the bpmn20.xml file:

<process id="process" isExecutable="true">
    <startEvent id="sid-154EFE65-1AC3-4482-8B94-EC47422406B8"/>
    <sequenceFlow id="sid-6EF930B8-197D-40B8-9489-30FDF5BF5EEF" sourceRef="sid-154EFE65-1AC3-4482-8B94-EC47422406B8" targetRef="sid-2E3117FA-1BE6-457C-ADF3-8A9E3EE491FE"/>
    <endEvent id="sid-22AC7BC9-E838-44BD-A17E-1B43F1C5F0F5"/>
    <serviceTask id="sid-2E3117FA-1BE6-457C-ADF3-8A9E3EE491FE"/>    <!– where's the resultVariable="testVar"? –>
    <sequenceFlow id="sid-852ACB0D-C1A4-4CC9-A282-5563FF1A8CCA" sourceRef="sid-2E3117FA-1BE6-457C-ADF3-8A9E3EE491FE" targetRef="sid-22AC7BC9-E838-44BD-A17E-1B43F1C5F0F5"/>
My real example uses an expression like this: ${mam_wfe.execute()}.

I tried a few things:
a) When I use the result variable "testVar", e.g. in a following decision task, I see an error message telling that "testVar" doesn't exist. So it's not only a question of the export, it also doesn't execute as I expect it to do.
b) When I add the resultVariable="testVar" attribute manually to the file, execute the Activiti Engine in a unit test, deploy the process definition and execute it, it runs fine. The variable is set and can be used in expressions.
c) When I upload the modified file in the Activiti Explorer, deploy the process and start it, the variable is *not* set. The process fails if I use the testVar variable in an expression later in the process.
Am I doing something fundamentally wrong or is there a bug somewhere?