Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build variable mapping expression #356

Closed
remcowesterhoud opened this issue Oct 29, 2021 · 1 comment · Fixed by #377
Closed

Failed to build variable mapping expression #356

remcowesterhoud opened this issue Oct 29, 2021 · 1 comment · Fixed by #377
Assignees

Comments

@remcowesterhoud
Copy link
Contributor

remcowesterhoud commented Oct 29, 2021

Describe the bug
I deploy a a process with a specific output variable mapping. Instead of breaking on the validation, the broker throws an exception and the deployment fails.

To Reproduce

Deploy this process using Zeebe 1.2

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1l8zqol" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.11.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="1.1.0">
  <bpmn:process id="Process_00dmwud" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:outgoing>Flow_0b71pnj</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:endEvent id="Event_12llkjs">
      <bpmn:incoming>Flow_0hl1ts4</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_0b71pnj" sourceRef="StartEvent_1" targetRef="Activity_13r0dql" />
    <bpmn:sequenceFlow id="Flow_0hl1ts4" sourceRef="Activity_13r0dql" targetRef="Event_12llkjs" />
    <bpmn:serviceTask id="Activity_13r0dql">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="type" retries="1" />
        <zeebe:ioMapping>
          <zeebe:output source="= result.CheckProcess.generalClassifications.operational[type=&#34;ACCOUNTING_PERIOD_VALIDATION&#34;][1]" target="accountingPeriodValidation.operational" />
          <zeebe:output source="= result.CheckProcess.generalClassifications.heating[type=&#34;ACCOUNTING_PERIOD_VALIDATION&#34;][1]" target="accountingPeriodValidation.heating" />
          <zeebe:output source="= result.CheckProcess.tenancy.utilityBill.operational" target="formalRequirementValidation.operational" />
          <zeebe:output source="= result.CheckProcess.tenancy.utilityBill.heating" target="formalRequirementValidation.heating" />
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0b71pnj</bpmn:incoming>
      <bpmn:outgoing>Flow_0hl1ts4</bpmn:outgoing>
    </bpmn:serviceTask>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_00dmwud">
      <bpmndi:BPMNEdge id="Flow_0hl1ts4_di" bpmnElement="Flow_0hl1ts4">
        <di:waypoint x="360" y="117" />
        <di:waypoint x="412" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_0b71pnj_di" bpmnElement="Flow_0b71pnj">
        <di:waypoint x="215" y="117" />
        <di:waypoint x="260" y="117" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
        <dc:Bounds x="179" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Event_12llkjs_di" bpmnElement="Event_12llkjs">
        <dc:Bounds x="412" y="99" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Activity_0s27z46_di" bpmnElement="Activity_13r0dql">
        <dc:Bounds x="260" y="77" width="100" height="80" />
      </bpmndi:BPMNShape>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

The process above contains the original output variable mappings. I've pinpointed it down a bit.
Expression = x.y[z = 0][1] causes this issue. = x[z = 0][1] works without a problem. = x.y[z = 0] also works without issue.

Expected behavior
I think the expression is a valid expression. If it is, the deployment should succeed. If it is not I would expect the broker to fail on a validation instead of throwing an exception.

Environment

@saig0
Copy link
Member

saig0 commented Dec 27, 2021

I can reproduce the bug with the following expression:

 {z: x.y[1][1]}.z

> Failure(failed to parse expression ' {z: x.y[1][1]}.z ': Expected (expressionWithContinuation | functionDefinition | forExpression | ifExpression | quantifiedExpression | expression2):1:2, found "{z: x.y[1]")

The bug is already fixed in version 1.14.0. I added a new test case for this unary-tests expression with #377.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants