This is an automated email from the ASF dual-hosted git repository.

jomarko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new a98c6247fa9     kie-tools-issues#4039: Backward incompatibility of 
BPMN Editors for DMN Business Rule Task (#4040)
a98c6247fa9 is described below

commit a98c6247fa97280798fda34ee1e1983e2f7bef76
Author: Jozef Marko <[email protected]>
AuthorDate: Mon Oct 19 12:36:22 2026 +0200

        kie-tools-issues#4039: Backward incompatibility of BPMN Editors for DMN 
Business Rule Task (#4040)
---
 packages/bpmn-editor/jest.config.js                |  30 +++++
 packages/bpmn-editor/package.json                  |   8 +-
 packages/bpmn-editor/src/mutations/_dataMapping.ts |  36 +++++-
 .../multiInstance/MultiInstanceProperties.tsx      |  32 +++++-
 .../MultiInstanceCheckbox.tsx                      |   1 -
 .../tests/mutations/getBpmnNamespacePrefix.test.ts |  84 ++++++++++++++
 .../tests/mutations/setDataMapping.test.ts         | 121 +++++++++++++++++++++
 packages/bpmn-editor/tsconfig.tests.json           |   3 +
 pnpm-lock.yaml                                     |  23 +++-
 9 files changed, 322 insertions(+), 16 deletions(-)

diff --git a/packages/bpmn-editor/jest.config.js 
b/packages/bpmn-editor/jest.config.js
new file mode 100644
index 00000000000..cd848227e0f
--- /dev/null
+++ b/packages/bpmn-editor/jest.config.js
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const { config, babelTransform, typescriptTransform } = 
require("@kie-tools/jest-base/jest.config");
+
+/** @type {import('ts-jest').JestConfigWithTsJest} */
+module.exports = {
+  ...config,
+  testEnvironment: "node",
+  transform: {
+    ...babelTransform,
+    ...typescriptTransform,
+  },
+};
diff --git a/packages/bpmn-editor/package.json 
b/packages/bpmn-editor/package.json
index dbffcf604af..2c7cfbc964b 100644
--- a/packages/bpmn-editor/package.json
+++ b/packages/bpmn-editor/package.json
@@ -9,13 +9,14 @@
   ],
   "scripts": {
     "build:dev": "rimraf dist && pnpm copy:css && tsc -p tsconfig.json",
-    "build:prod": "rimraf dist && pnpm copy:css && pnpm lint && tsc -p 
tsconfig.json && pnpm test-e2e",
+    "build:prod": "rimraf dist && pnpm copy:css && pnpm lint && tsc -p 
tsconfig.json && pnpm test && pnpm test-e2e",
     "build:storybook": "rimraf dist-storybook && storybook build -o 
dist-storybook",
     "copy:css": "copyfiles -u 1 \"src/**/*.{sass,scss,css}\" dist/",
     "lint": "run-script-if --bool \"$(build-env linters.run)\" --then 
\"kie-tools--eslint ./src\"",
     "start": "run-script-os",
     "start:linux:darwin": "cross-env STORYBOOK_PORT=$(build-env 
bpmnEditor.storybook.port) pnpm exec kie-tools--storybook --storybookArgs=\"dev 
--no-open\"",
     "start:win32": "pnpm powershell \"cross-env STORYBOOK_PORT=$(build-env 
bpmnEditor.storybook.port) pnpm exec kie-tools--storybook --storybookArgs='dev 
--no-open'",
+    "test": "run-script-if --ignore-errors \"$(build-env 
tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest 
--silent --verbose --passWithNoTests\"",
     "test-e2e": "run-script-if --ignore-errors \"$(build-env 
endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" 
--then \"pnpm test-e2e:condition\"",
     "test-e2e:condition": "run-script-if --bool \"$(build-env 
endToEndTests.containerized)\" --then  \"pnpm rimraf ./dist-tests-e2e\" \"pnpm 
test-e2e:container:run\" --else \"pnpm rimraf ./dist-tests-e2e\" \"pnpm 
test-e2e:run\"",
     "test-e2e:container:clean": "playwright-base-container clean",
@@ -64,6 +65,7 @@
     "@babel/preset-typescript": "^7.22.5",
     "@kie-tools-core/webpack-base": "workspace:*",
     "@kie-tools/eslint": "workspace:*",
+    "@kie-tools/jest-base": "workspace:*",
     "@kie-tools/playwright-base": "workspace:*",
     "@kie-tools/root-env": "workspace:*",
     "@kie-tools/storybook-base": "workspace:*",
@@ -78,6 +80,7 @@
     "@storybook/react-webpack5": "^7.3.2",
     "@types/d3-drag": "^3.0.3",
     "@types/d3-selection": "^3.0.6",
+    "@types/jest": "^29.5.12",
     "@types/lodash": "^4.14.168",
     "@types/node": "^24.13.3",
     "@types/react": "^18.3.12",
@@ -88,12 +91,15 @@
     "cross-env": "^7.0.3",
     "deep-object-diff": "^1.1.9",
     "file-loader": "^6.2.0",
+    "jest": "^29.7.0",
+    "jest-junit": "^17.0.0",
     "lodash": "^4.18.1",
     "raw-loader": "^4.0.2",
     "rimraf": "^3.0.2",
     "run-script-os": "^1.1.6",
     "start-server-and-test": "^2.0.3",
     "storybook": "^7.3.2",
+    "ts-jest": "^29.1.5",
     "typescript": "^5.9.3",
     "webpack": "^5.108.4",
     "webpack-cli": "^7.2.1",
diff --git a/packages/bpmn-editor/src/mutations/_dataMapping.ts 
b/packages/bpmn-editor/src/mutations/_dataMapping.ts
index abd04109dd1..cfc60edaf9f 100644
--- a/packages/bpmn-editor/src/mutations/_dataMapping.ts
+++ b/packages/bpmn-editor/src/mutations/_dataMapping.ts
@@ -225,6 +225,27 @@ import { addOrGetProcessAndDiagramElements } from 
"./addOrGetProcessAndDiagramEl
 import { visitFlowElementsAndArtifacts } from "./_elementVisitor";
 import { DEFAULT_DATA_TYPES } from "./addOrGetItemDefinitions";
 
+export const BPMN20_MODEL_NAMESPACE = 
"http://www.omg.org/spec/BPMN/20100524/MODEL";;
+
+export function getBpmnNamespacePrefix(definitions?: 
Normalized<BPMN20__tDefinitions>): string {
+  if (!definitions) {
+    return "";
+  }
+
+  for (const [key, value] of Object.entries(definitions)) {
+    if (value === BPMN20_MODEL_NAMESPACE) {
+      if (key === "@_xmlns") {
+        return "";
+      }
+      if (key.startsWith("@_xmlns:")) {
+        return `${key.slice("@_xmlns:".length)}:`;
+      }
+    }
+  }
+
+  return "";
+}
+
 export function setInputDataMapping(
   itemDefinitionIdByDataTypes: Map<string, string>,
   inputDataMapping: DataMapping[],
@@ -232,6 +253,7 @@ export function setInputDataMapping(
   elementWithAssociation: WithInputDataMapping | WithDataMapping,
   definitions?: Normalized<BPMN20__tDefinitions>
 ) {
+  const bpmnPrefix = getBpmnNamespacePrefix(definitions);
   elementWithData.dataInput = [];
   elementWithAssociation.dataInputAssociation = [];
 
@@ -256,7 +278,7 @@ export function setInputDataMapping(
                 "@_id": generateUuid(),
                 from: {
                   "@_id": generateUuid(),
-                  "@_xsi:type": "tFormalExpression",
+                  "@_xsi:type": `${bpmnPrefix}tFormalExpression`,
                   __$$text: dataMapping.value,
                 } as any,
                 to: { "@_id": generateUuid(), __$$text: dataInput["@_id"] },
@@ -279,6 +301,7 @@ export function setOutputDataMapping(
   elementWithAssociation: WithOutputDataMapping | WithDataMapping,
   definitions?: Normalized<BPMN20__tDefinitions>
 ) {
+  const bpmnPrefix = getBpmnNamespacePrefix(definitions);
   elementWithData.dataOutput = [];
   elementWithAssociation.dataOutputAssociation = [];
 
@@ -304,7 +327,7 @@ export function setOutputDataMapping(
                 from: { "@_id": generateUuid(), __$$text: dataOutput["@_id"] },
                 to: {
                   "@_id": generateUuid(),
-                  "@_xsi:type": "tFormalExpression",
+                  "@_xsi:type": `${bpmnPrefix}tFormalExpression`,
                   __$$text: dataMapping.value,
                 } as any,
               },
@@ -323,7 +346,8 @@ export function setInputAndOutputDataMapping(
   itemDefinitionIdByDataTypes: Map<string, string>,
   inputDataMapping: DataMapping[],
   outputDataMapping: DataMapping[],
-  e: WithDataMapping
+  e: WithDataMapping,
+  definitions?: Normalized<BPMN20__tDefinitions>
 ) {
   e.ioSpecification = {
     "@_id": generateUuid(),
@@ -334,7 +358,7 @@ export function setInputAndOutputDataMapping(
   };
 
   // input
-  setInputDataMapping(itemDefinitionIdByDataTypes, inputDataMapping, 
e.ioSpecification, e);
+  setInputDataMapping(itemDefinitionIdByDataTypes, inputDataMapping, 
e.ioSpecification, e, definitions);
 
   e.ioSpecification.inputSet[0] ??= {
     "@_id": generateUuid(),
@@ -347,7 +371,7 @@ export function setInputAndOutputDataMapping(
   }
 
   // output
-  setOutputDataMapping(itemDefinitionIdByDataTypes, outputDataMapping, 
e.ioSpecification, e);
+  setOutputDataMapping(itemDefinitionIdByDataTypes, outputDataMapping, 
e.ioSpecification, e, definitions);
 
   e.ioSpecification!.outputSet[0] ??= {
     "@_id": generateUuid(),
@@ -391,7 +415,7 @@ export function setDataMappingForElement({
         e.__$$element === "serviceTask" ||
         e.__$$element === "scriptTask"
       ) {
-        setInputAndOutputDataMapping(itemDefinitionIdByDataTypes, 
inputDataMapping, outputDataMapping, e);
+        setInputAndOutputDataMapping(itemDefinitionIdByDataTypes, 
inputDataMapping, outputDataMapping, e, definitions);
       } else if (e.__$$element === "endEvent" || e.__$$element === 
"intermediateThrowEvent") {
         setInputDataMapping(itemDefinitionIdByDataTypes, inputDataMapping, e, 
e, definitions);
       } else if (
diff --git 
a/packages/bpmn-editor/src/propertiesPanel/multiInstance/MultiInstanceProperties.tsx
 
b/packages/bpmn-editor/src/propertiesPanel/multiInstance/MultiInstanceProperties.tsx
index 6b21a708b8a..e2ab08a42a2 100644
--- 
a/packages/bpmn-editor/src/propertiesPanel/multiInstance/MultiInstanceProperties.tsx
+++ 
b/packages/bpmn-editor/src/propertiesPanel/multiInstance/MultiInstanceProperties.tsx
@@ -203,7 +203,13 @@ export function MultiInstanceProperties({ element }: { 
element: WithMultiInstanc
                       .map((i) => [i["@_structureRef"]!, i["@_id"]!])
                   );
 
-                  setInputDataMapping(itemDefinitionIdByDataTypes, 
inputDataMapping, addOrGetIoSpecification(e), e);
+                  setInputDataMapping(
+                    itemDefinitionIdByDataTypes,
+                    inputDataMapping,
+                    addOrGetIoSpecification(e),
+                    e,
+                    s.bpmn.model.definitions
+                  );
 
                   if (newVariableRef) {
                     const ioSpecificationReference = 
addOrGetIoSpecification(e).dataInput?.find(
@@ -261,7 +267,13 @@ export function MultiInstanceProperties({ element }: { 
element: WithMultiInstanc
                         .map((i) => [i["@_structureRef"]!, i["@_id"]!])
                     );
 
-                    setInputDataMapping(itemDefinitionIdByDataTypes, 
inputDataMapping, addOrGetIoSpecification(e), e);
+                    setInputDataMapping(
+                      itemDefinitionIdByDataTypes,
+                      inputDataMapping,
+                      addOrGetIoSpecification(e),
+                      e,
+                      s.bpmn.model.definitions
+                    );
 
                     const ioSpecificationReference = 
addOrGetIoSpecification(e).dataInput?.find(
                       (dIn) =>
@@ -351,7 +363,13 @@ export function MultiInstanceProperties({ element }: { 
element: WithMultiInstanc
                       .map((i) => [i["@_structureRef"]!, i["@_id"]!])
                   );
 
-                  setOutputDataMapping(itemDefinitionIdByDataTypes, 
outputDataMapping, addOrGetIoSpecification(e), e);
+                  setOutputDataMapping(
+                    itemDefinitionIdByDataTypes,
+                    outputDataMapping,
+                    addOrGetIoSpecification(e),
+                    e,
+                    s.bpmn.model.definitions
+                  );
 
                   if (newVariableRef) {
                     const ioSpecificationReference = 
addOrGetIoSpecification(e).dataOutput?.find(
@@ -412,7 +430,13 @@ export function MultiInstanceProperties({ element }: { 
element: WithMultiInstanc
                         .map((i) => [i["@_structureRef"]!, i["@_id"]!])
                     );
 
-                    setOutputDataMapping(itemDefinitionIdByDataTypes, 
outputDataMapping, addOrGetIoSpecification(e), e);
+                    setOutputDataMapping(
+                      itemDefinitionIdByDataTypes,
+                      outputDataMapping,
+                      addOrGetIoSpecification(e),
+                      e,
+                      s.bpmn.model.definitions
+                    );
 
                     const ioSpecificationReference = 
addOrGetIoSpecification(e).dataOutput?.find(
                       (dOut) =>
diff --git 
a/packages/bpmn-editor/src/propertiesPanel/multiInstanceCheckbox/MultiInstanceCheckbox.tsx
 
b/packages/bpmn-editor/src/propertiesPanel/multiInstanceCheckbox/MultiInstanceCheckbox.tsx
index 1fdc4da84b5..5c68212497e 100644
--- 
a/packages/bpmn-editor/src/propertiesPanel/multiInstanceCheckbox/MultiInstanceCheckbox.tsx
+++ 
b/packages/bpmn-editor/src/propertiesPanel/multiInstanceCheckbox/MultiInstanceCheckbox.tsx
@@ -32,7 +32,6 @@ import "./MultiInstanceCheckbox.css";
 import {
   updateDataMappingWithVariableRef,
   setDataMappingForElement,
-  setOutputDataMapping,
   getDataMapping,
 } from "../../mutations/_dataMapping";
 import { useBpmnEditorI18n } from "../../i18n";
diff --git 
a/packages/bpmn-editor/tests/mutations/getBpmnNamespacePrefix.test.ts 
b/packages/bpmn-editor/tests/mutations/getBpmnNamespacePrefix.test.ts
new file mode 100644
index 00000000000..8866442067e
--- /dev/null
+++ b/packages/bpmn-editor/tests/mutations/getBpmnNamespacePrefix.test.ts
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BPMN20_MODEL_NAMESPACE, getBpmnNamespacePrefix } from 
"../../src/mutations/_dataMapping";
+
+describe("getBpmnNamespacePrefix", () => {
+  it("returns empty string when definitions is undefined", () => {
+    expect(getBpmnNamespacePrefix(undefined)).toBe("");
+  });
+
+  it("returns empty string when definitions has no namespace entries", () => {
+    const definitions = { "@_id": "def1" } as any;
+    expect(getBpmnNamespacePrefix(definitions)).toBe("");
+  });
+
+  it("returns empty string when BPMN model namespace is bound to the default 
xmlns (no prefix)", () => {
+    // Files where xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"; — no 
prefix needed
+    const definitions = {
+      "@_id": "def1",
+      "@_xmlns": BPMN20_MODEL_NAMESPACE,
+    } as any;
+    expect(getBpmnNamespacePrefix(definitions)).toBe("");
+  });
+
+  it("returns 'bpmn2:' when BPMN model namespace is bound to the bpmn2 
prefix", () => {
+    // Files edited with older editors that use bpmn2: as namespace prefix
+    const definitions = {
+      "@_id": "def1",
+      "@_xmlns:bpmn2": BPMN20_MODEL_NAMESPACE,
+    } as any;
+    expect(getBpmnNamespacePrefix(definitions)).toBe("bpmn2:");
+  });
+
+  it("returns 'bpmn:' when BPMN model namespace is bound to a custom 'bpmn' 
prefix", () => {
+    const definitions = {
+      "@_id": "def1",
+      "@_xmlns:bpmn": BPMN20_MODEL_NAMESPACE,
+    } as any;
+    expect(getBpmnNamespacePrefix(definitions)).toBe("bpmn:");
+  });
+
+  it("returns empty string when a different namespace is bound to xmlns but 
not the BPMN model namespace", () => {
+    const definitions = {
+      "@_id": "def1",
+      "@_xmlns": "http://some.other.namespace";,
+      "@_xmlns:bpmn2": "http://also.other.namespace";,
+    } as any;
+    expect(getBpmnNamespacePrefix(definitions)).toBe("");
+  });
+
+  it("ignores non-xmlns keys that happen to have the BPMN model namespace as 
value", () => {
+    const definitions = {
+      "@_id": "def1",
+      "@_targetNamespace": BPMN20_MODEL_NAMESPACE,
+    } as any;
+    expect(getBpmnNamespacePrefix(definitions)).toBe("");
+  });
+
+  it("returns the first matching prefix when multiple xmlns entries are 
present", () => {
+    // In practice only one will match, but the function returns the first hit
+    const definitions = {
+      "@_id": "def1",
+      "@_xmlns:bpmn2": BPMN20_MODEL_NAMESPACE,
+      "@_xmlns:other": "http://other.ns";,
+    } as any;
+    expect(getBpmnNamespacePrefix(definitions)).toBe("bpmn2:");
+  });
+});
diff --git a/packages/bpmn-editor/tests/mutations/setDataMapping.test.ts 
b/packages/bpmn-editor/tests/mutations/setDataMapping.test.ts
new file mode 100644
index 00000000000..65e8289691a
--- /dev/null
+++ b/packages/bpmn-editor/tests/mutations/setDataMapping.test.ts
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  BPMN20_MODEL_NAMESPACE,
+  DataMapping,
+  setInputDataMapping,
+  setOutputDataMapping,
+} from "../../src/mutations/_dataMapping";
+
+const itemDefinitionIdByDataTypes = new Map<string, string>([["Object", 
"_itemDefinition"]]);
+
+const expressionMapping: DataMapping = {
+  name: "myData",
+  dtype: "Object",
+  isExpression: true,
+  value: "some-expression",
+};
+
+const variableMapping: DataMapping = {
+  name: "myData",
+  dtype: "Object",
+  isExpression: false,
+  variableRef: "myVariable",
+};
+
+const definitionsWithBpmn2Prefix = {
+  "@_id": "def1",
+  "@_xmlns:bpmn2": BPMN20_MODEL_NAMESPACE,
+} as any;
+
+const definitionsWithDefaultNamespace = {
+  "@_id": "def1",
+  "@_xmlns": BPMN20_MODEL_NAMESPACE,
+} as any;
+
+describe("setInputDataMapping", () => {
+  function run(dataMapping: DataMapping, definitions?: any) {
+    const element: any = {};
+    setInputDataMapping(itemDefinitionIdByDataTypes, [dataMapping], element, 
element, definitions);
+    return element;
+  }
+
+  it("uses the 'bpmn2:' prefix in @_xsi:type when BPMN model namespace is 
bound to bpmn2", () => {
+    const element = run(expressionMapping, definitionsWithBpmn2Prefix);
+
+    expect(element.dataInputAssociation).toHaveLength(1);
+    
expect(element.dataInputAssociation[0].assignment[0].from["@_xsi:type"]).toBe("bpmn2:tFormalExpression");
+    
expect(element.dataInputAssociation[0].assignment[0].from.__$$text).toBe("some-expression");
+  });
+
+  it("uses no prefix in @_xsi:type when BPMN model namespace is the default 
xmlns", () => {
+    const element = run(expressionMapping, definitionsWithDefaultNamespace);
+
+    
expect(element.dataInputAssociation[0].assignment[0].from["@_xsi:type"]).toBe("tFormalExpression");
+  });
+
+  it("uses no prefix in @_xsi:type when definitions is undefined", () => {
+    const element = run(expressionMapping, undefined);
+
+    
expect(element.dataInputAssociation[0].assignment[0].from["@_xsi:type"]).toBe("tFormalExpression");
+  });
+
+  it("does not create an assignment for non-expression mappings", () => {
+    const element = run(variableMapping, definitionsWithBpmn2Prefix);
+
+    expect(element.dataInputAssociation[0].assignment).toBeUndefined();
+    expect(element.dataInputAssociation[0].sourceRef).toEqual([{ __$$text: 
"myVariable" }]);
+  });
+});
+
+describe("setOutputDataMapping", () => {
+  function run(dataMapping: DataMapping, definitions?: any) {
+    const element: any = {};
+    setOutputDataMapping(itemDefinitionIdByDataTypes, [dataMapping], element, 
element, definitions);
+    return element;
+  }
+
+  it("uses the 'bpmn2:' prefix in @_xsi:type when BPMN model namespace is 
bound to bpmn2", () => {
+    const element = run(expressionMapping, definitionsWithBpmn2Prefix);
+
+    expect(element.dataOutputAssociation).toHaveLength(1);
+    
expect(element.dataOutputAssociation[0].assignment[0].to["@_xsi:type"]).toBe("bpmn2:tFormalExpression");
+    
expect(element.dataOutputAssociation[0].assignment[0].to.__$$text).toBe("some-expression");
+  });
+
+  it("uses no prefix in @_xsi:type when BPMN model namespace is the default 
xmlns", () => {
+    const element = run(expressionMapping, definitionsWithDefaultNamespace);
+
+    
expect(element.dataOutputAssociation[0].assignment[0].to["@_xsi:type"]).toBe("tFormalExpression");
+  });
+
+  it("uses no prefix in @_xsi:type when definitions is undefined", () => {
+    const element = run(expressionMapping, undefined);
+
+    
expect(element.dataOutputAssociation[0].assignment[0].to["@_xsi:type"]).toBe("tFormalExpression");
+  });
+
+  it("does not create an assignment for non-expression mappings", () => {
+    const element = run(variableMapping, definitionsWithBpmn2Prefix);
+
+    expect(element.dataOutputAssociation[0].assignment).toBeUndefined();
+    expect(element.dataOutputAssociation[0].targetRef).toEqual({ __$$text: 
"myVariable" });
+  });
+});
diff --git a/packages/bpmn-editor/tsconfig.tests.json 
b/packages/bpmn-editor/tsconfig.tests.json
new file mode 100644
index 00000000000..fc8520e7376
--- /dev/null
+++ b/packages/bpmn-editor/tsconfig.tests.json
@@ -0,0 +1,3 @@
+{
+  "extends": "./tsconfig.json"
+}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fb1c13a1695..1e073804dd4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1450,6 +1450,9 @@ importers:
       '@kie-tools/eslint':
         specifier: workspace:*
         version: link:../eslint
+      '@kie-tools/jest-base':
+        specifier: workspace:*
+        version: link:../jest-base
       '@kie-tools/playwright-base':
         specifier: workspace:*
         version: link:../playwright-base
@@ -1485,13 +1488,16 @@ importers:
         version: 
7.6.24([email protected])([email protected]([email protected]))([email protected])([email protected])
       '@storybook/react-webpack5':
         specifier: ^7.3.2
-        version: 
7.6.24(@babel/[email protected])(@swc/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])
+        version: 
7.6.24(@babel/[email protected])(@swc/[email protected](@swc/[email protected]))(@swc/[email protected])([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])
       '@types/d3-drag':
         specifier: ^3.0.3
         version: 3.0.7
       '@types/d3-selection':
         specifier: ^3.0.6
         version: 3.0.11
+      '@types/jest':
+        specifier: ^29.5.12
+        version: 29.5.14
       '@types/lodash':
         specifier: ^4.14.168
         version: 4.17.24
@@ -1522,6 +1528,12 @@ importers:
       file-loader:
         specifier: ^6.2.0
         version: 6.2.0([email protected])
+      jest:
+        specifier: ^29.7.0
+        version: 
29.7.0(@types/[email protected])([email protected](@swc/[email protected](@swc/[email protected]))(@types/[email protected])([email protected]))
+      jest-junit:
+        specifier: ^17.0.0
+        version: 17.0.0
       lodash:
         specifier: ^4.18.1
         version: 4.18.1
@@ -1540,12 +1552,15 @@ importers:
       storybook:
         specifier: ^7.3.2
         version: 7.6.24([email protected])
+      ts-jest:
+        specifier: ^29.1.5
+        version: 
29.4.12(@babel/[email protected])(@jest/[email protected])(@jest/[email protected])([email protected](@babel/[email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected](@swc/[email protected](@swc/[email protected]))(@types/[email protected])([email protected])))([email protected])
       typescript:
         specifier: ^5.9.3
         version: 5.9.3
       webpack:
         specifier: ^5.108.4
-        version: 5.108.4([email protected])([email protected])
+        version: 
5.108.4(@swc/[email protected](@swc/[email protected]))([email protected])([email protected])
       webpack-cli:
         specifier: ^7.2.1
         version: 
7.2.1([email protected])([email protected])([email protected])([email protected])([email protected])
@@ -32172,7 +32187,7 @@ snapshots:
       '@babel/core': 7.29.7
       find-cache-dir: 4.0.0
       schema-utils: 4.3.3
-      webpack: 5.108.4([email protected])([email protected])
+      webpack: 
5.108.4(@swc/[email protected](@swc/[email protected]))([email protected])([email protected])
 
   [email protected]: {}
 
@@ -41478,7 +41493,7 @@ snapshots:
       jest-worker: 27.5.1
       schema-utils: 4.3.3
       terser: 5.49.0
-      webpack: 5.108.4([email protected])([email protected])
+      webpack: 
5.108.4(@swc/[email protected](@swc/[email protected]))([email protected])([email protected])
     optionalDependencies:
       '@swc/core': 1.15.46(@swc/[email protected])
       postcss: 8.5.22


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to