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

Regex in DMN replaced in output #4530

Open
3 tasks
mboskamp opened this issue Aug 12, 2024 · 1 comment
Open
3 tasks

Regex in DMN replaced in output #4530

mboskamp opened this issue Aug 12, 2024 · 1 comment
Assignees
Labels
potential:7.21.6 potential:7.22.1 type:bug Issues that describe a user-facing bug in the project. version:7.23.0

Comments

@mboskamp
Copy link
Member

mboskamp commented Aug 12, 2024

Environment (Required on creation)

  • Any Camunda 7 version
  • Feel Scala version: 1.17.5

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

When using a regex in a DMN row's output, after an instance triggered the row, the output is changed. The escaped regex characters are transformed (e.g., \s -> )

Steps to reproduce (Required on creation)

  • Deploy a simple DMN with a regex string (e.g., test\s\r\ntest in the output column.
  • Execute an instance (e.g., through BPMN or REST API) triggering the row with the regex output.
  • 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>

Observed Behavior (Required on creation)

The output of the triggered DMN row is changed. The escaped characters are transformed.

Expected behavior (Required on creation)

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

Root Cause (Required on prioritization)

The FEEL Scala engine transforms certain escaped characters during parsing. See code .

Solution Ideas

This has to be fixed in FEEL Scala and the fixed version needs to be used in Camunda Platform 7.

Hints

Links

Breakdown

Pull Requests

  1. mboskamp

Dev2QA handover

  • Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment
@mboskamp
Copy link
Member Author

mboskamp commented Sep 25, 2024

A fix was implemented in the feel-scala engine.
Tasks for C7 would be:

  • Adopt a new version of feel-scala that contains the fix.
  • Educate the users how to properly use escape characters in DMN (i.e. use double backslashes \\n\\r etc.).
    • I will reach out to the customer once the fix is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
potential:7.21.6 potential:7.22.1 type:bug Issues that describe a user-facing bug in the project. version:7.23.0
Projects
None yet
Development

No branches or pull requests

3 participants