Bug 852118 - Namespace mismatch in on-entry script
Summary: Namespace mismatch in on-entry script
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM 5, Tooling (JBDS)
Version: BRMS 5.3.1
Hardware: Unspecified
OS: Unspecified
Target Milestone: ER4
: One Off Releases
Assignee: Kris Verlaenen
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2012-08-27 16:18 UTC by Tihomir Surdilovic
Modified: 2024-01-01 01:36 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed:
Type: Bug

Attachments (Terms of Use)
BPMN2 created by JBDS (2.57 KB, application/xml)
2012-12-04 07:17 UTC, Marek Winkler
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPM-3728 0 Blocker Resolved Namespace mismatch in on-entry script 2018-05-22 05:52:08 UTC

Description Tihomir Surdilovic 2012-08-27 16:18:26 UTC
There is a name space mismatch between the on-entry scripts(<script> created from the web designer and those created from eclipse. Due to this, when we save a process with on-entry actions from eclipse to guvnor, the process doesn't get saved proerly.
xml from eclipse:
<definitions id="Definition"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>System.out.println("Inside task1 of test1 process");</script>
XML from designer:
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.omg.org/bpmn20" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" id="_LoFNkNTEEeGK1qo_QQKeyQ" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd" targetNamespace="http://www.omg.org/bpmn20">
<drools:onEntry-script scriptFormat="http://www.java.com/java">
<drools:script><![CDATA[System.out.println("Inside task 1 of test process");]]></drools:script>

Comment 1 Sona Mala 2012-10-02 11:40:54 UTC
What should be change? I create process with onEntryScript in Designer and same process in Eclipse. I set Drools runtime and JBPM runtime to brms-standalone-5.3.1/jboss-as/client/{drools|jbpm}. But I cannot find any differences between this "description" and source codes which was generated by designer/eclipse.

there are still:
  - same namespaces
  - eclipse do not use CDATA in <script>

By the way, I am not able to import BPMN process from eclipse to designer. (import from designer to eclipse is ok). There occurs alert "Failed to import BPMN2. Check server logs for more details." and in server.log is ERROR org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Feature 'script' not found. (inputStream://dummyUriWithValidSuffix.xml, 22, 19)

Comment 2 Sona Mala 2012-10-08 13:37:34 UTC
I tried verified this issue for JBDS 5.0.0v20120615-1714-H213-GA and jBPM{Core|Task} 5.3.3.Final and I can reproduce this issue. Please can you write me, where I can found this fix in Eclipse plugin?

Comment 3 Tihomir Surdilovic 2012-10-08 13:47:37 UTC
One thing that should happen is that the eclipse process editor should create the correct namespace now (<drools:script> instead of <script>). If you create a process with onEntry/Exit actions with the newest tooling it should import in designer fine without issues.

Comment 5 Tihomir Surdilovic 2012-10-31 13:31:03 UTC
Checked and the fix was never merged into the jbpm product branch for 5.3.1. Let me know what to do - this BZ does not have a blocker flag set.

Comment 6 Tihomir Surdilovic 2012-10-31 13:52:23 UTC
Done - since tooling uses the runtime parser you have to build the runtime and tooling in order to test the fix. 

To test you can create a simple task with onEntry and onExist action (can be dummy). In the generated BPMN2 you should see like:

<userTask id="_4" name="User Task" >

-- note the <tns:script> (namespaced) script node inside <tns:onEntry-script> (same should be on onExit-script). Previously the script node was not namespaced so was just <script> ... </script>.

Comment 7 Tihomir Surdilovic 2012-10-31 23:21:45 UTC
moving to "modified" as fix is in jbpm production 5.2.x branch now

Comment 9 Marek Winkler 2012-11-15 13:50:22 UTC
The bug is still present - script element remains without namespace.

Tested using JBDS 5.0.1.v20121025-1751-H2-GA (obtained from http://www.qa.jboss.com/binaries/RHDS/updates/development/5.0.1.GA.soa-tooling/) and BRMS 5.3.1.BRMS-ER4. If there is already a more recent JBDS plugin version to verify against, please let me know.

Unable to verify, since I am waiting for new JBDS plugin release.

Comment 10 Marek Winkler 2012-12-03 16:49:17 UTC
Verified that the script element is properly namespaced on BRMS 5.3.1 CR1 and JBDS 5.0.2 GA (from update site http://www.qa.jboss.com/binaries/RHDS/updates/development/5.0.2.GA.soa-tooling/).

However, the process definition created in JBDS still fails to import into Guvnor. No specific error message is written to server.log (although Guvnor says that it should have been logged). Will continue investigating with Tihomir.

Comment 11 Tihomir Surdilovic 2012-12-03 19:16:44 UTC
Could you please upload the bpmn2 created by the Eclipse editor?


Comment 12 Marek Winkler 2012-12-04 07:17:14 UTC
Created attachment 657258 [details]
BPMN2 created by JBDS

Attached BPMN2 generated by JBDS which fails to import into Guvnor.

Comment 15 Marek Winkler 2012-12-04 10:54:41 UTC
We have found that the error is somehow related to "tns:packageName" attribute of "process" element (see below). If this attribute is manually removed, the process definition created in JBDS imports successfully into Guvnor.

<definitions ...

  <process ... tns:packageName="defaultPackage">

Comment 16 Tihomir Surdilovic 2012-12-04 13:48:46 UTC
I'm not sure it's related to the packageName attribute, but I think the namespace definition.   targetNamespace="http://www.jboss.org/drools"

if you remove the targetNamespace it imports fine.

Comment 17 Tihomir Surdilovic 2012-12-04 13:53:26 UTC
The BPMN2 generated by eclipse already has:
so I think there is no need to have  targetNamespace="http://www.jboss.org/drools" as well.

I think this is a separate issue which needs its own BZ. WDYT?

Comment 18 Marek Winkler 2012-12-04 14:02:02 UTC
Agreed, I am going to file another BZ for this issue and marking this BZ as verified on BRMS 5.3.1 CR1 and JBDS 5.0.2 GA (from update site http://www.qa.jboss.com/binaries/RHDS/updates/development/5.0.2.GA.soa-tooling/).

Note You need to log in before you can comment on or make changes to this bug.