cancel
Showing results for 
Search instead for 
Did you mean: 

Designer 5.6 does not set activiti:elementVariable in xml

pcsquirrel
Champ in-the-making
Champ in-the-making
Hi,

if I create a multiInstance UserTask the "activiti:elementVariable" in the resulting bpmn20.xml is not the value I entered in the Designer. instead the value of "activiti:collection" is used there too.

test.activiti:

<?xml version="1.0" encoding="ASCII"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:al="http://eclipse.org/graphiti/mm/algorithms" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL-XMI" xmlns:pi="http://eclipse.org/graphiti/mm/pictograms">
  <pi:Diagram visible="true" gridUnit="10" diagramTypeId="BPMNdiagram" name="MyProcess.activiti" snapToGrid="true" showGuides="true" pictogramLinks="/0/@children.0/@link /0/@children.1/@link /0/@children.2/@link /0/@children.2/@children.0/@link /0/@connections.0/@link /0/@connections.1/@link">
    <graphicsAlgorithm xsi:type="al:Rectangle" background="/0/@colors.1" foreground="/0/@colors.0" width="1000" height="1000"/>
    <children xsi:type="pi:ContainerShape" visible="true" active="true">
      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false" width="35" height="35" x="76" y="58">
        <graphicsAlgorithmChildren xsi:type="al:Ellipse" width="35" height="35" style="/0/@styles.0"/>
      </graphicsAlgorithm>
      <link businessObjects="startevent1"/>
      <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="/0/@connections.0"/>
      <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="/0/@children.0/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
        <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
      </anchors>
    </children>
    <children xsi:type="pi:ContainerShape" visible="true" active="true">
      <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false" width="35" height="35" x="390" y="58">
        <graphicsAlgorithmChildren xsi:type="al:Ellipse" lineWidth="3" width="35" height="35" style="/0/@styles.0"/>
      </graphicsAlgorithm>
      <link businessObjects="endevent1"/>
      <anchors xsi:type="pi:ChopboxAnchor" incomingConnections="/0/@connections.1"/>
    </children>
    <children xsi:type="pi:ContainerShape" visible="true" active="true">
      <graphicsAlgorithm xsi:type="al:Rectangle" filled="false" lineVisible="false" width="105" height="55" x="210" y="48">
        <graphicsAlgorithmChildren xsi:type="al:RoundedRectangle" width="105" height="55" style="/0/@styles.1" cornerHeight="20" cornerWidth="20"/>
      </graphicsAlgorithm>
      <link businessObjects="usertask1"/>
      <anchors xsi:type="pi:ChopboxAnchor" outgoingConnections="/0/@connections.1" incomingConnections="/0/@connections.0"/>
      <anchors xsi:type="pi:BoxRelativeAnchor" visible="true" active="true" referencedGraphicsAlgorithm="/0/@children.2/@graphicsAlgorithm/@graphicsAlgorithmChildren.0" relativeWidth="1.0" relativeHeight="0.51">
        <graphicsAlgorithm xsi:type="al:Ellipse" filled="false" lineVisible="false"/>
      </anchors>
      <children visible="true">
        <graphicsAlgorithm xsi:type="al:Text" width="105" height="20" y="20" style="/0/@styles.1" horizontalAlignment="ALIGNMENT_CENTER" value="User Task">
          <font name="Arial" size="8"/>
        </graphicsAlgorithm>
        <link businessObjects="usertask1"/>
      </children>
      <children visible="true">
        <graphicsAlgorithm xsi:type="al:Image" width="16" height="16" x="5" y="5" id="org.activiti.designer.usertask" stretchH="false" stretchV="false" proportional="false"/>
      </children>
    </children>
    <styles foreground="/0/@colors.2" lineWidth="20" id="EVENT">
      <renderingStyle>
        <adaptedGradientColoredAreas definedStyleId="bpmnEventStyle" gradientType="0">
          <adaptedGradientColoredAreas styleAdaption="0">
            <gradientColor>
              <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
                <color red="250" green="251" blue="252"/>
              </start>
              <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
                <color red="250" green="251" blue="252"/>
              </end>
            </gradientColor>
          </adaptedGradientColoredAreas>
          <adaptedGradientColoredAreas styleAdaption="0">
            <gradientColor>
              <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </start>
              <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </end>
            </gradientColor>
          </adaptedGradientColoredAreas>
          <adaptedGradientColoredAreas styleAdaption="0">
            <gradientColor>
              <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </start>
              <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </end>
            </gradientColor>
          </adaptedGradientColoredAreas>
        </adaptedGradientColoredAreas>
      </renderingStyle>
    </styles>
    <styles foreground="/0/@colors.2" lineWidth="20" id="TASK">
      <renderingStyle>
        <adaptedGradientColoredAreas definedStyleId="bpmnTaskStyle" gradientType="0">
          <adaptedGradientColoredAreas styleAdaption="0">
            <gradientColor>
              <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
                <color red="250" green="251" blue="252"/>
              </start>
              <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
                <color red="255" green="255" blue="204"/>
              </end>
            </gradientColor>
          </adaptedGradientColoredAreas>
          <adaptedGradientColoredAreas styleAdaption="0">
            <gradientColor>
              <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </start>
              <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </end>
            </gradientColor>
          </adaptedGradientColoredAreas>
          <adaptedGradientColoredAreas styleAdaption="0">
            <gradientColor>
              <start locationType="LOCATION_TYPE_ABSOLUTE_START" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </start>
              <end locationType="LOCATION_TYPE_ABSOLUTE_END" locationValue="0">
                <color red="229" green="229" blue="194"/>
              </end>
            </gradientColor>
          </adaptedGradientColoredAreas>
        </adaptedGradientColoredAreas>
      </renderingStyle>
    </styles>
    <styles background="/0/@colors.2" foreground="/0/@colors.2" id="BPMN-POLYGON-ARROW"/>
    <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="/0/@children.0/@anchors.0" end="/0/@children.2/@anchors.0">
      <graphicsAlgorithm xsi:type="al:Polyline" foreground="/0/@colors.2" filled="false"/>
      <link businessObjects="flow1"/>
      <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
        <graphicsAlgorithm xsi:type="al:Text" x="10" style="/0/@styles.1" value="">
          <font name="Arial" size="8"/>
        </graphicsAlgorithm>
      </connectionDecorators>
      <connectionDecorators visible="true" locationRelative="true" location="1.0">
        <graphicsAlgorithm xsi:type="al:Polygon" style="/0/@styles.2">
          <points x="-10" y="-5" before="3" after="3"/>
          <points/>
          <points x="-10" y="5" before="3" after="3"/>
          <points x="-8" before="3" after="3"/>
        </graphicsAlgorithm>
      </connectionDecorators>
    </connections>
    <connections xsi:type="pi:FreeFormConnection" visible="true" active="true" start="/0/@children.2/@anchors.0" end="/0/@children.1/@anchors.0">
      <graphicsAlgorithm xsi:type="al:Polyline" foreground="/0/@colors.2" filled="false"/>
      <link businessObjects="flow2"/>
      <connectionDecorators visible="true" active="true" locationRelative="true" location="0.5">
        <graphicsAlgorithm xsi:type="al:Text" x="10" style="/0/@styles.1" value="">
          <font name="Arial" size="8"/>
        </graphicsAlgorithm>
      </connectionDecorators>
      <connectionDecorators visible="true" locationRelative="true" location="1.0">
        <graphicsAlgorithm xsi:type="al:Polygon" style="/0/@styles.2">
          <points x="-10" y="-5" before="3" after="3"/>
          <points/>
          <points x="-10" y="5" before="3" after="3"/>
          <points x="-8" before="3" after="3"/>
        </graphicsAlgorithm>
      </connectionDecorators>
    </connections>
    <colors red="227" green="238" blue="249"/>
    <colors red="255" green="255" blue="255"/>
    <colors/>
  </pi:Diagram>
  <bpmn2:Process id="MyProcess" name="MyProcess">
    <documentation id="documentation_process" text="Place documentation for the 'MyProcess' process here."/>
  </bpmn2:Process>
  <bpmn2:StartEvent id="startevent1" name="Start" outgoing="flow1"/>
  <bpmn2:EndEvent id="endevent1" name="End" incoming="flow2"/>
  <bpmn2:UserTask id="usertask1" name="User Task" incoming="flow1" outgoing="flow2" assignee="kermit" formKey="">
    <documentation text=""/>
    <loopCharacteristics xsi:type="bpmn2:MultiInstanceLoopCharacteristics" isSequential="true" loopCardinality="" inputDataItem="${userColl}" completionCondition="" elementVariable="assignee"/>
  </bpmn2:UserTask>
  <bpmn2:SequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="usertask1"/>
  <bpmn2:SequenceFlow id="flow2" name="" sourceRef="usertask1" targetRef="endevent1"/>
</xmi:XMI>


resulting test.bpmn20.xml:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="MyProcess" name="MyProcess">
    <documentation>Place documentation for the 'MyProcess' process here.</documentation>
    <startEvent id="startevent1" name="Start"></startEvent>
    <endEvent id="endevent1" name="End"></endEvent>
    <userTask id="usertask1" name="User Task" activiti:assignee="kermit">
      <multiInstanceLoopCharacteristics isSequential="true" activiti:collection="${userColl}" activiti:elementVariable="${userColl}"></multiInstanceLoopCharacteristics>
    </userTask>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="usertask1"></sequenceFlow>
    <sequenceFlow id="flow2" name="" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_MyProcess">
    <bpmndi:BPMNPlane bpmnElement="MyProcess" id="BPMNPlane_MyProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35" width="35" x="76" y="58"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35" width="35" x="390" y="58"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55" width="105" x="210" y="48"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="111" y="75"></omgdi:waypoint>
        <omgdi:waypoint x="210" y="75"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="315" y="75"></omgdi:waypoint>
        <omgdi:waypoint x="390" y="75"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

the line
<multiInstanceLoopCharacteristics isSequential="true" activiti:collection="${userColl}" activiti:elementVariable="${userColl}">

should be
<multiInstanceLoopCharacteristics isSequential="true" activiti:collection="${userColl}" activiti:elementVariable="assignee">


kind regards

Philipp Eichhorn
3 REPLIES 3

trademak
Star Contributor
Star Contributor
Hi,

Yeah that was a bug in 5.6. In the source code repo it's already solved.
On the Activiti wiki you can find how you can built the Designer from the source code if you would like to do that.

Best regards,

pcsquirrel
Champ in-the-making
Champ in-the-making
thank you

kind regards
Philipp Eichhorn

P.S. was it filled in JIRA? i searched there with no success.

trademak
Star Contributor
Star Contributor
Nope, it was a quick fix 😉
But I can create a JIRA issue to prevent people from searching for this in the future.

Best regards,