cancel
Showing results for 
Search instead for 
Did you mean: 

exclusive gateway problem - choice do not works

larry
Champ in-the-making
Champ in-the-making
Hi all,

I begin to use Activiti and I sketched the simplest work-flow containing a gateway (see file at the end of the message).
It doesn't work.
Within the JUnit test in Eclipse, everything works well, but in the Activity Explorer, I have an error:
- either "no outgoing sequence flow" if I place the values to compare, within simple/double quotes.
- or "unknown property used in expression" if I do not use quotes.

The environment I use is:
- Operating system : Linux Fedora 23 - 64 bits
- Java Oracle 1.8.65 - 64 bit
- Eclipse Juno - 64 bit
- Apache Tomcat 8 - 64 bit
- Activiti 5.18

Please tell me what do I do wrongly.
Thank you in advance for your help.

*****************************************

<?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:xsd="http://www.w3.org/2001/XMLSchema" 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="ztest" name="ZTest Process" isExecutable="true">
    <startEvent id="startevent1" name="Start">
      <extensionElements>
        <activiti:formProperty id="choix" name="Choix" type="enum" required="true">
          <activiti:value id="apple" name="Pomme"></activiti:value>
          <activiti:value id="pear" name="Poire"></activiti:value>
          <activiti:value id="plum" name="Prunne"></activiti:value>
        </activiti:formProperty>
      </extensionElements>
    </startEvent>
    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
    <scriptTask id="scriptWriteApple" name="Action Pommes" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>out.println("\n===Pommes===")</script>
    </scriptTask>
    <scriptTask id="scriptWritePear" name="Action Poires" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>out.println("\n===Poires===")</script>
    </scriptTask>
    <scriptTask id="scriptWritePlum" name="Action Prunes" scriptFormat="groovy" activiti:autoStoreVariables="false">
      <script>out.println("\n===Prunes===")</script>
    </scriptTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow7" sourceRef="startevent1" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flowChioceApple" name="Apple branch" sourceRef="exclusivegateway1" targetRef="scriptWriteApple">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${choix=='apple'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flowChiocePear" name="Pear Branch" sourceRef="exclusivegateway1" targetRef="scriptWritePear">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${choix=='pear'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flowChiocePlum" name="Plum branch" sourceRef="exclusivegateway1" targetRef="scriptWritePlum">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${choix=='plum'}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flowEndApple" sourceRef="scriptWriteApple" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flowEndPear" sourceRef="scriptWritePear" targetRef="endevent1"></sequenceFlow>
    <sequenceFlow id="flowEndPlum" sourceRef="scriptWritePlum" targetRef="endevent1"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_ztest">
    <bpmndi:BPMNPlane bpmnElement="ztest" id="BPMNPlane_ztest">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="100.0" y="171.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
        <omgdc:Bounds height="40.0" width="40.0" x="170.0" y="168.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="scriptWriteApple" id="BPMNShape_scriptWriteApple">
        <omgdc:Bounds height="55.0" width="105.0" x="271.0" y="80.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="scriptWritePear" id="BPMNShape_scriptWritePear">
        <omgdc:Bounds height="55.0" width="105.0" x="271.0" y="161.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="scriptWritePlum" id="BPMNShape_scriptWritePlum">
        <omgdc:Bounds height="55.0" width="105.0" x="273.0" y="240.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35.0" width="35.0" x="405.0" y="171.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="135.0" y="188.0"></omgdi:waypoint>
        <omgdi:waypoint x="170.0" y="188.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flowChioceApple" id="BPMNEdge_flowChioceApple">
        <omgdi:waypoint x="190.0" y="168.0"></omgdi:waypoint>
        <omgdi:waypoint x="190.0" y="107.0"></omgdi:waypoint>
        <omgdi:waypoint x="271.0" y="107.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="12.0" width="100.0" x="170.0" y="91.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flowChiocePear" id="BPMNEdge_flowChiocePear">
        <omgdi:waypoint x="210.0" y="188.0"></omgdi:waypoint>
        <omgdi:waypoint x="271.0" y="188.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="12.0" width="100.0" x="209.0" y="170.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flowChiocePlum" id="BPMNEdge_flowChiocePlum">
        <omgdi:waypoint x="190.0" y="208.0"></omgdi:waypoint>
        <omgdi:waypoint x="190.0" y="267.0"></omgdi:waypoint>
        <omgdi:waypoint x="273.0" y="267.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="12.0" width="59.0" x="200.0" y="249.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flowEndApple" id="BPMNEdge_flowEndApple">
        <omgdi:waypoint x="376.0" y="107.0"></omgdi:waypoint>
        <omgdi:waypoint x="422.0" y="108.0"></omgdi:waypoint>
        <omgdi:waypoint x="422.0" y="171.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flowEndPear" id="BPMNEdge_flowEndPear">
        <omgdi:waypoint x="376.0" y="188.0"></omgdi:waypoint>
        <omgdi:waypoint x="405.0" y="188.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flowEndPlum" id="BPMNEdge_flowEndPlum">
        <omgdi:waypoint x="378.0" y="267.0"></omgdi:waypoint>
        <omgdi:waypoint x="422.0" y="266.0"></omgdi:waypoint>
        <omgdi:waypoint x="422.0" y="206.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

*****************************************
4 REPLIES 4

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Larry,

do you have `choix` variable set in your activiti-explorer process instance?

Regards
Martin

larry
Champ in-the-making
Champ in-the-making
Hi Martin,

Thank you for your answer.
I suppose the variable "choix" is initialized automatically within the activiti-explorer process instance.

I declare this variable within a form:
<code>
<activiti:formProperty id="choix" name="Choix" type="enum" required="true">
</code>
… and I find that (I quote from "https://forums.activiti.org/content/how-store-and-retrieve-process-instance-variable-values-explorer..."):
"All form values are stored as process variables, so putting them on the form automatically makes it a process variable."

Isn't that right?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Larry,

What is the value of choix variable?

Regards
Martin

larry
Champ in-the-making
Champ in-the-making
Hi all,

I figured it, eventually.
The problem was … that I used to deploy a process via "Processes"->"Model workspace"->"Import", then "Deploy".
It doesn't work, I do not know why.

Today I successfully deployed my first workflow and it works like a charm.
I did that via "Manage"->"Deployments"->"Upload New".

So, case closed … unless someone can explain me why it works the second way and not the first.