Bug 852118 - Namespace mismatch in on-entry script
Namespace mismatch in on-entry script
Status: VERIFIED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM 5, Tooling (JBDS) (Show other bugs)
BRMS 5.3.1
Unspecified Unspecified
unspecified Severity unspecified
: ER4
: One Off Releases
Assigned To: Kris Verlaenen
Marek Winkler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-27 12:18 EDT by Tihomir Surdilovic
Modified: 2013-10-10 20:15 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBPM-3728 Blocker Resolved Namespace mismatch in on-entry script 2017-08-27 05:32 EDT

  None (edit)
Description Tihomir Surdilovic 2012-08-27 12:18:26 EDT
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"
targetNamespace="http://www.jboss.org/drools"
typeLanguage="http://www.java.com/javaTypes"
expressionLanguage="http://www.mvel.org/2.0"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
xmlns:g="http://www.jboss.org/drools/flow/gpd"
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:tns="http://www.jboss.org/drools">
....
....
<extensionElements>
<tns:onEntry-script scriptFormat="http://www.java.com/java">
<script>System.out.println("Inside task1 of test1 process");</script>
</tns:onEntry-script>
</extensionElements>
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">
<bpmn2:extensionElements>
<drools:onEntry-script scriptFormat="http://www.java.com/java">
<drools:script><![CDATA[System.out.println("Inside task 1 of test process");]]></drools:script>
</drools:onEntry-script>
</bpmn2:extensionElements>
Comment 1 Sona Mala 2012-10-02 07:40:54 EDT
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 09:37:34 EDT
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 09:47:37 EDT
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 09:31:03 EDT
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 09:52:23 EDT
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" >
      <extensionElements>
        <tns:onEntry-script>
          <tns:script>System.out.println("OnEntry");</tns:script>
        </tns:onEntry-script>
        <tns:onExit-script>
          <tns:script>System.out.println("OnExit");</tns:script>
        </tns:onExit-script>
      </extensionElements>
      <ioSpecification>
        <inputSet>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
    </userTask>

-- 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 19:21:45 EDT
moving to "modified" as fix is in jbpm production 5.2.x branch now
Comment 9 Marek Winkler 2012-11-15 08:50:22 EST
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 11:49:17 EST
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 14:16:44 EST
Could you please upload the bpmn2 created by the Eclipse editor?

Thanks.
Comment 12 Marek Winkler 2012-12-04 02:17:14 EST
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 05:54:41 EST
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 ...
    xmlns:tns="http://www.jboss.org/drools">

  <process ... tns:packageName="defaultPackage">
  ...
Comment 16 Tihomir Surdilovic 2012-12-04 08:48:46 EST
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 08:53:26 EST
The BPMN2 generated by eclipse already has:
xmlns:tns="http://www.jboss.org/drools"
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 09:02:02 EST
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.