camunda-bpm-platform
camunda-bpm-platform copied to clipboard
Regex in DMN replaced in output
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
- Depends on: https://github.com/camunda/feel-scala/issues/883
- related to https://jira.camunda.com/browse/SUPPORT-23111
Breakdown
### Pull Requests
Dev2QA handover
- [ ] Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment