This is an automated email from the ASF dual-hosted git repository.
thiagoelg 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 86dd774cd07 kie-issues#2304: BPMN Editor: Usertask On-entry script
scriptFormat not persisted (#3578)
86dd774cd07 is described below
commit 86dd774cd078dbc6edaf715e358057ecf0148e2f
Author: Rajalakshmy S <[email protected]>
AuthorDate: Thu May 21 22:55:54 2026 +0530
kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not
persisted (#3578)
Co-authored-by: Rajalakshmy S <[email protected]>
---
.../OnEntryAndExitScriptsFormSection.tsx | 5 +--
.../src/propertiesPanel/scriptFormats.ts | 36 ++++++++++++++++++++++
.../singleNodeProperties/ScriptTaskProperties.tsx | 2 ++
3 files changed, 41 insertions(+), 2 deletions(-)
diff --git
a/packages/bpmn-editor/src/propertiesPanel/onEntryAndExitScripts/OnEntryAndExitScriptsFormSection.tsx
b/packages/bpmn-editor/src/propertiesPanel/onEntryAndExitScripts/OnEntryAndExitScriptsFormSection.tsx
index d335ae7e9f0..c0f85b68514 100644
---
a/packages/bpmn-editor/src/propertiesPanel/onEntryAndExitScripts/OnEntryAndExitScriptsFormSection.tsx
+++
b/packages/bpmn-editor/src/propertiesPanel/onEntryAndExitScripts/OnEntryAndExitScriptsFormSection.tsx
@@ -23,6 +23,7 @@ import { useState } from "react";
import { SectionHeader } from
"@kie-tools/xyflow-react-kie-diagram/dist/propertiesPanel/SectionHeader";
import { CodeIcon } from "@patternfly/react-icons/dist/js/icons/code-icon";
import { CodeInput } from "../codeInput/CodeInput";
+import { getScriptFormat, ScriptLanguage } from "../scriptFormats";
import { BPMN20__tProcess } from
"@kie-tools/bpmn-marshaller/dist/schemas/bpmn-2_0/ts-gen/types";
import { ElementFilter } from "@kie-tools/xml-parser-ts/dist/elementFilter";
import { Unpacked } from
"@kie-tools/xyflow-react-kie-diagram/dist/tsExt/tsExt";
@@ -86,7 +87,7 @@ export function OnEntryAndExitScriptsFormSection({ element }:
{ element: WithOnE
if (e["@_id"] === element?.["@_id"] && e.__$$element ===
element.__$$element) {
e.extensionElements ??= {};
e.extensionElements["drools:onEntry-script"] ??= {
- "@_scriptFormat": "",
+ "@_scriptFormat":
getScriptFormat(ScriptLanguage.Java),
"drools:script": { __$$text: "" },
};
e.extensionElements["drools:onEntry-script"]["drools:script"].__$$text =
newValue;
@@ -109,7 +110,7 @@ export function OnEntryAndExitScriptsFormSection({ element
}: { element: WithOnE
if (e["@_id"] === element?.["@_id"] && e.__$$element ===
element.__$$element) {
e.extensionElements ??= {};
e.extensionElements["drools:onExit-script"] ??= {
- "@_scriptFormat": "",
+ "@_scriptFormat":
getScriptFormat(ScriptLanguage.Java),
"drools:script": { __$$text: "" },
};
e.extensionElements["drools:onExit-script"]["drools:script"].__$$text =
newValue;
diff --git a/packages/bpmn-editor/src/propertiesPanel/scriptFormats.ts
b/packages/bpmn-editor/src/propertiesPanel/scriptFormats.ts
new file mode 100644
index 00000000000..93e5fba1632
--- /dev/null
+++ b/packages/bpmn-editor/src/propertiesPanel/scriptFormats.ts
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+export enum ScriptLanguage {
+ Java = "Java",
+ MVEL = "MVEL",
+ Drools = "Drools",
+ FEEL = "FEEL",
+}
+
+const SCRIPT_LANGUAGE_FORMATS: Record<ScriptLanguage, string> = {
+ [ScriptLanguage.Java]: "http://www.java.com/java",
+ [ScriptLanguage.MVEL]: "http://www.mvel.org/2.0",
+ [ScriptLanguage.Drools]: "http://www.jboss.org/drools/rule",
+ [ScriptLanguage.FEEL]: "http://www.omg.org/spec/DMN/20180521/FEEL/",
+};
+
+export function getScriptFormat(language: ScriptLanguage): string {
+ return SCRIPT_LANGUAGE_FORMATS[language];
+}
diff --git
a/packages/bpmn-editor/src/propertiesPanel/singleNodeProperties/ScriptTaskProperties.tsx
b/packages/bpmn-editor/src/propertiesPanel/singleNodeProperties/ScriptTaskProperties.tsx
index c7a49e99485..802af70d1a0 100644
---
a/packages/bpmn-editor/src/propertiesPanel/singleNodeProperties/ScriptTaskProperties.tsx
+++
b/packages/bpmn-editor/src/propertiesPanel/singleNodeProperties/ScriptTaskProperties.tsx
@@ -25,6 +25,7 @@ import { PropertiesPanelHeaderFormSection } from
"./_PropertiesPanelHeaderFormSe
import { TaskIcon } from "../../diagram/nodes/NodeIcons";
import { Divider } from "@patternfly/react-core/dist/js/components/Divider";
import { CodeInput } from "../codeInput/CodeInput";
+import { getScriptFormat, ScriptLanguage } from "../scriptFormats";
import { AdhocAutostartCheckbox } from
"../adhocAutostartCheckbox/AdhocAutostartCheckbox";
import { AsyncCheckbox } from "../asyncCheckbox/AsyncCheckbox";
import { useBpmnEditorStoreApi } from "../../store/StoreContext";
@@ -62,6 +63,7 @@ export function ScriptTaskProperties({
if (e["@_id"] === scriptTask["@_id"] && e.__$$element ===
scriptTask.__$$element) {
e.script ??= { __$$text: newScript || "" };
e.script.__$$text = newScript;
+ e["@_scriptFormat"] = getScriptFormat(ScriptLanguage.Java);
}
});
});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]