我正在開發一個包含在正在部署到Camunda的.war文件中的BPMN圖。該圖顯示正常,我可以完成前兩個用戶任務,但是當我到達獨佔網關時,我收到錯誤消息:表達式中使用了未知屬性:$ {Approve == 1}。原因:無法解析標識符'批准'具有3輸出專用網關的BPMN圖在Camunda中不工作
我還沒有確定變量批准,但我不確定在哪裏做到這一點?我一直使用的BPMN圖.xml文件,其中涉及到的唯一網關的代碼如下:
<bpmn:sequenceFlow id="SequenceFlow_07b7fwg" name="Approve" sourceRef="ExclusiveGateway_0znxqqy" targetRef="ServiceTask_06fn5cm">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${Approve == 1}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_0qnqvj1" sourceRef="ServiceTask_06fn5cm" targetRef="EndEvent_146k48m" />
<bpmn:endEvent id="EndEvent_0ug591n" name="End">
<bpmn:incoming>SequenceFlow_1y6i7xo</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="SequenceFlow_068nx8b" name="Reject" sourceRef="ExclusiveGateway_0znxqqy" targetRef="ServiceTask_17qnuyi">
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${Reject == 2}</bpmn:conditionExpression>
</bpmn:sequenceFlow>
<bpmn:sequenceFlow id="SequenceFlow_1irpvhx" sourceRef="ServiceTask_17qnuyi" targetRef="ServiceTask_1jks4hs" />
<bpmn:sequenceFlow id="SequenceFlow_1mjdjw2" sourceRef="ServiceTask_1jks4hs" targetRef="EndEvent_1qmduq" />
<bpmn:endEvent id="EndEvent_1qmduq" name="Hello!" />
<bpmn:sequenceFlow id="SequenceFlow_1deve3u" name="Extra Step" sourceRef="ExclusiveGateway_0znxqqy" targetRef="ServiceTask_09nq79v" />
<bpmn:sequenceFlow id="SequenceFlow_1y6i7xo" sourceRef="ServiceTask_09nq79v" targetRef="EndEvent_0ug591n" />
這是基於由Camunda這裏提供的代碼:https://docs.camunda.org/manual/7.4/reference/bpmn20/gateways/exclusive-gateway/
在Eclipse中創建的每個步驟都有一些.java文件,並引用同一個BPMN圖。我不確定是否應該在.xml文件或.java文件中定義變量,以及如何去做這件事?謝謝。