You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "rajalakshmys-27 (via GitHub)" <gi...@apache.org> on 2026/05/14 08:41:15 UTC

[PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

rajalakshmys-27 opened a new pull request, #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578

   Closes: [kie-issues#2304](https://github.com/apache/incubator-kie-issues/issues/2304)
   
   ### Root Cause
   When adding on-entry/on-exit scripts to user tasks or editing script tasks, the `scriptFormat` attribute was being initialized with an empty string instead of the proper format URI. This occurred because the code was hardcoding `""` as the default value when creating new script elements.
   
   ### Fix
   - Created a centralized mapping of script language names to their corresponding format URIs
   - Implemented a helper function to retrieve the correct format URI based on the language
   - Updated script initialization logic to use the proper format URI (defaulting to Java format) instead of empty strings
   - Applied the fix to on-entry scripts, on-exit scripts, and script task properties
   
   This ensures that generated XML contains valid `scriptFormat` attributes, preventing compilation failures.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

Posted by "ljmotta (via GitHub)" <gi...@apache.org>.
ljmotta commented on code in PR #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578#discussion_r3262385191


##########
packages/bpmn-editor/src/propertiesPanel/scriptFormats.ts:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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 const SCRIPT_LANGUAGE_FORMATS: Record<string, string> = {
+  Java: "http://www.java.com/java",
+  MVEL: "http://www.mvel.org/2.0",
+  Drools: "http://www.jboss.org/drools/rule",
+  DROOLS: "http://www.jboss.org/drools/rule",
+  drools: "http://www.jboss.org/drools/rule",
+  FEEL: "http://www.omg.org/spec/DMN/20180521/FEEL/",
+};

Review Comment:
   Use a "string enum" to ensure typesafety. Also, the current structure contain redudant values (e.g. `Drools`, `DROOLS`, `drools`)
   
   The current `getScriptFormat` function can receive any string value, which is innacurate.
   
    



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

Posted by "jomarko (via GitHub)" <gi...@apache.org>.
jomarko commented on PR #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578#issuecomment-4514951654

   Can you share links for the reported additional tickets please?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

Posted by "thiagoelg (via GitHub)" <gi...@apache.org>.
thiagoelg commented on PR #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578#issuecomment-4510823685

   > > Thank you for the PR. I have this uncertainties about it.
   > > ### 01 BPMN Elements with a script
   > > Does this PR handle all situations, when user should set a script? For example there is also a script when we have an edge form the gateway.
   > > <img alt="Image" width="1586" height="677" src="https://private-user-images.githubusercontent.com/8044780/593901766-d42ba135-0062-4b35-9e11-5853a2d97ce3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzkzNTQ0MjQsIm5iZiI6MTc3OTM1NDEyNCwicGF0aCI6Ii84MDQ0NzgwLzU5MzkwMTc2Ni1kNDJiYTEzNS0wMDYyLTRiMzUtOWUxMS01ODUzYTJkOTdjZTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDUyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA1MjFUMDkwMjA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmFmNWNkOWZiMjBjY2QzZWVmZTA4ZmNkNDVkMDI0NDU0NDQ2MGY5YTViZmY4OGEzNmQ0NmEwOTYxYmNjNTQwMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.kRTiInQ3Fssqs6mEEEg1uRKL-xKgBzzAuozFOxb4i4Y">
   > > ### 02 Script Change
   > > The added code brings an impression, many script languages can be used. However looking on the properties panel, it seems there is only indicator of the script language, shouldn't be there an option to change the script language if we add similar PR?
   > > ### 03 Script Support
   > > This is related to **02**. Are we sure that using all mentioned scripts
   > > 
   > > * Java
   > > * Mvel
   > > * Drools
   > > * Feel
   > > 
   > > are supported everywhere:
   > > 
   > > * script task
   > > * entry / exit scripts
   > > * edges from gateways
   > > * conditional events
   > > 
   > > in other words, will run such bpmn definitions fine in our kogito-examples?
   > 
   > **PR Intent:** Fix the bug where `scriptFormat` was left empty in BPMN script tasks and on-entry/on-exit scripts. This ensures generated BPMN XML is valid and executable.
   > 
   > ### Question 01: BPMN Elements with a Script
   > **Does this PR handle all situations when a user should set a script?** Answer : No, that is another issue.
   > 
   > * Handled: Script Tasks, On-Entry Scripts, On-Exit Scripts -> all now set @_scriptFormat properly.
   > * Not handled: Gateway edge conditions (sequence flows). These use @_language, not @_scriptFormat.
   >   So,
   > * Script elements and expression elements rely on different attributes (scriptFormat vs language).
   > * The missing @_language on gateway edge conditions is outside the scope of this PR and should be tracked separately.
   > 
   > ### Question 02: Script Change
   > **Should there be an option to change the script language?** Answer: No, that is another issue that can be handled as a separate enhancement.
   > 
   > * The current UI only shows Java as the default.
   > * This PR fixes the bug by ensuring (Java) scripts have a valid URI.
   > * Supporting multi-language selection (Java, MVEL, Drools, FEEL) would require additional change
   > 
   > ### Question 03: Script Support
   > **Are all mentioned scripts (Java, MVEL, Drools, FEEL) supported everywhere?** Answer: Unclear, needs testing. This PR correctly implements Java, which is the only language currently used in script tasks.
   > 
   > Context	Java	MVEL	Drools	FEEL	Attribute Used
   > Script Tasks	Yes	No	No	No	`@_scriptFormat`
   > Entry/Exit Scripts	Yes	No	No	No	`@_scriptFormat`
   > Gateway Edges	UI shows options, but `@_language` missing				`@_language`
   > Conditional Events	Drools used				`@_language`
   > Multi-instance Completion	MVEL used				`@_language`
   > We can Open separate **issues** to:
   > 
   > * Add `@_language` to expression elements.
   > * Align UI options with real supported languages.
   > * Test actual language support in `kogito-examples`.
   > 
   > CC : @thiagoelg @Kusuma04-dev
   
   Thank you for the responses! Can you create new issues (in incubator-kie-issues) so we can tackle these missing features in the future? Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

Posted by "rajalakshmys-27 (via GitHub)" <gi...@apache.org>.
rajalakshmys-27 commented on PR #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578#issuecomment-4507143424

   > Thank you for the PR. I have this uncertainties about it.
   > 
   > ### 01 BPMN Elements with a script
   > Does this PR handle all situations, when user should set a script? For example there is also a script when we have an edge form the gateway.
   > 
   > <img alt="Image" width="1586" height="677" src="https://private-user-images.githubusercontent.com/8044780/593901766-d42ba135-0062-4b35-9e11-5853a2d97ce3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzkzNTQ0MjQsIm5iZiI6MTc3OTM1NDEyNCwicGF0aCI6Ii84MDQ0NzgwLzU5MzkwMTc2Ni1kNDJiYTEzNS0wMDYyLTRiMzUtOWUxMS01ODUzYTJkOTdjZTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDUyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA1MjFUMDkwMjA0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZmFmNWNkOWZiMjBjY2QzZWVmZTA4ZmNkNDVkMDI0NDU0NDQ2MGY5YTViZmY4OGEzNmQ0NmEwOTYxYmNjNTQwMCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.kRTiInQ3Fssqs6mEEEg1uRKL-xKgBzzAuozFOxb4i4Y">
   > ### 02 Script Change
   > The added code brings an impression, many script languages can be used. However looking on the properties panel, it seems there is only indicator of the script language, shouldn't be there an option to change the script language if we add similar PR?
   > 
   > ### 03 Script Support
   > This is related to **02**. Are we sure that using all mentioned scripts
   > 
   > * Java
   > * Mvel
   > * Drools
   > * Feel
   > 
   > are supported everywhere:
   > 
   > * script task
   > * entry / exit scripts
   > * edges from gateways
   > * conditional events
   > 
   > in other words, will run such bpmn definitions fine in our kogito-examples?
   
   
   **PR Intent:** Fix the bug where `scriptFormat` was left empty in BPMN script tasks and on-entry/on-exit scripts.  
   This ensures generated BPMN XML is valid and executable.
   
   
   ### Question 01: BPMN Elements with a Script  
   **Does this PR handle all situations when a user should set a script?**
   Answer : No, that is another issue.
   - Handled: Script Tasks, On-Entry Scripts, On-Exit Scripts -> all now set @_scriptFormat properly.
   - Not handled: Gateway edge conditions (sequence flows). These use @_language, not @_scriptFormat.
   So,
   - Script elements and expression elements rely on different attributes (scriptFormat vs language).
   - The missing @_language on gateway edge conditions is outside the scope of this PR and should be tracked separately.
   
   ### Question 02: Script Change  
   **Should there be an option to change the script language?**
   Answer: No, that is another issue that can be handled as a separate enhancement.
   - The current UI only shows Java as the default.  
   - This PR fixes the bug by ensuring (Java) scripts have a valid URI.  
   - Supporting multi-language selection (Java, MVEL, Drools, FEEL) would require additional change
   
   ### Question 03: Script Support  
   **Are all mentioned scripts (Java, MVEL, Drools, FEEL) supported everywhere?**
   Answer: Unclear, needs testing. This PR correctly implements Java, which is the only language currently used in script tasks.
   
   | Context | Java | MVEL | Drools | FEEL | Attribute Used |
   | --- | --- | --- | --- | --- | --- |
   | Script Tasks | Yes | No | No | No | `@_scriptFormat` |
   | Entry/Exit Scripts | Yes | No | No | No | `@_scriptFormat` |
   | Gateway Edges | UI shows options, but `@_language` missing | | | | `@_language` |
   | Conditional Events | Drools used | | | | `@_language` |
   | Multi-instance Completion | MVEL used | | | | `@_language` |
   
   We can Open separate **issues** to:  
     - Add `@_language` to expression elements.  
     - Align UI options with real supported languages.
     - Test actual language support in `kogito-examples`.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

Posted by "rajalakshmys-27 (via GitHub)" <gi...@apache.org>.
rajalakshmys-27 commented on code in PR #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578#discussion_r3280410089


##########
packages/bpmn-editor/src/propertiesPanel/scriptFormats.ts:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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 const SCRIPT_LANGUAGE_FORMATS: Record<string, string> = {
+  Java: "http://www.java.com/java",
+  MVEL: "http://www.mvel.org/2.0",
+  Drools: "http://www.jboss.org/drools/rule",
+  DROOLS: "http://www.jboss.org/drools/rule",
+  drools: "http://www.jboss.org/drools/rule",
+  FEEL: "http://www.omg.org/spec/DMN/20180521/FEEL/",
+};

Review Comment:
   thanks @ljmotta ! Fixed, introduced a `ScriptLanguage` string enum, typed `SCRIPT_LANGUAGE_FORMATS` as `Record<ScriptLanguage, string>`, and removed the duplicate `DROOLS`/`drools` entries. `getScriptFormat` now only accepts `ScriptLanguage` values.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

Posted by "ljmotta (via GitHub)" <gi...@apache.org>.
ljmotta commented on PR #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578#issuecomment-4510093056

   @rajalakshmys-27 Thanks for addressing the change requests. Approved the PR.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] kie-issues#2304: BPMN Editor: Usertask On-entry script scriptFormat not persisted [incubator-kie-tools]

Posted by "thiagoelg (via GitHub)" <gi...@apache.org>.
thiagoelg merged PR #3578:
URL: https://github.com/apache/incubator-kie-tools/pull/3578


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org