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

FEEL engine replaces regex expressions in output #883

Closed
mboskamp opened this issue Aug 12, 2024 · 0 comments · Fixed by #930
Closed

FEEL engine replaces regex expressions in output #883

mboskamp opened this issue Aug 12, 2024 · 0 comments · Fixed by #930
Assignees
Labels
support relates to a support case type: bug

Comments

@mboskamp
Copy link
Member

mboskamp commented Aug 12, 2024

Describe the bug

To Reproduce
Steps to reproduce the behavior:
Using Camunda Platform 7:

  1. Deploy a simple DMN with a regex string (e.g., test\s\r\ntest in the output column.
  2. Execute an instance (e.g., through BPMN or REST API) triggering the row with the regex output.
  3. Check the output in Cockpit. The displayed regex string was changed. The escaped characters are transformed.
Example DMN
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:camunda="http://camunda.org/schema/1.0/dmn" id="Definitions_0g2ba0p" name="DRD" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="5.21.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.20.0">
  <decision id="regex" name="regex" camunda:historyTimeToLive="90">
    <decisionTable id="DecisionTable_1ac01ar">
      <input id="Input_1" label="Student Class" camunda:inputVariable="student_class">
        <inputExpression id="InputExpression_1" typeRef="integer">
          <text>student_class</text>
        </inputExpression>
      </input>
      <output id="Output_1" label="Regex" name="regex" typeRef="string" />
      <rule id="DecisionRule_0pa34gk">
        <inputEntry id="UnaryTests_1o9hf59">
          <text>1</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0oxhb51">
          <text>"\s\r\n"</text>
        </outputEntry>
      </rule>
    </decisionTable>
  </decision>
  <dmndi:DMNDI>
    <dmndi:DMNDiagram>
      <dmndi:DMNShape dmnElementRef="regex">
        <dc:Bounds height="80" width="180" x="160" y="100" />
      </dmndi:DMNShape>
    </dmndi:DMNDiagram>
  </dmndi:DMNDI>
</definitions>

Expected behavior
The output of the triggered DMN row is not changed. The escaped characters are not transformed. The original regex string is returned as output.

Solution idea

  • FEEL engine can handle escape and regex characters properly.
  • \s should not be replaced with a whitespace but handled the same way as \n and \r.

Environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support relates to a support case type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants