This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 153289 - Issue with XSD inheritance
Summary: Issue with XSD inheritance
Status: VERIFIED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: BPEL Mapper (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Nikita Krjukov
URL:
Keywords:
Depends on: 161685 161788 161793
Blocks:
  Show dependency tree
 
Reported: 2008-11-16 23:21 UTC by Murali Pottlapelli
Modified: 2009-04-23 23:32 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Project to reproduce issue (33.06 KB, application/octet-stream)
2008-11-16 23:23 UTC, Murali Pottlapelli
Details
new project to demonstrate the issue (9.63 KB, application/octet-stream)
2008-12-13 09:49 UTC, Murali Pottlapelli
Details
Corrected initial project (36.46 KB, application/x-compressed)
2008-12-15 19:33 UTC, Nikita Krjukov
Details
Another one corrected project. (10.62 KB, application/x-compressed)
2008-12-15 19:33 UTC, Nikita Krjukov
Details
Project attached on Dec 23 demonstrate new issues (33.33 KB, application/octet-stream)
2008-12-24 01:12 UTC, Murali Pottlapelli
Details
The mentioned project testProject-bp. It is a bit corrected here. (12.54 KB, application/octet-stream)
2009-01-22 23:34 UTC, Nikita Krjukov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Murali Pottlapelli 2008-11-16 23:21:36 UTC
Encountered few issue while testing XSD inheritance support. Issues are enumerated below and Project is attached.

Description of project.
It is simple synchronous business process which receives a message with one part (Person element) and replies with
another message with one part (Person element).

In Assign1 I have type casted 
A - "person" element ("PersonType") to "EmployeeType", it is extension of "PersonType"
B - "address" element ("AddressType") to "USAddressType", it is extension of "AddressType"

Issue - 1
It generates wrong xpath expression in Assign1 to set xsi:type, please refer to xpath expression below
                <copy>
                    <from>
                        <literal>ns2:USAddressType</literal>
                    </from>
                    <to>$BPTypeHierarchyOperationOut/ns1:person/ns1:address/@xsi:type</to>
                </copy>

Following "Assign1" I have added "if" and "Assign2" activities
If - verifies the value set on "empId", Assign2 sets value on "note" element.

Issue -2 
It generates redundant copy statements in Assign2, please note
"$BPTypeHierarchyOperationOut/ns1:person/ns1:address/@xsi:type" is invalid.
                <copy>
                    <from>
                        <literal>ns2:USAddressType</literal>
                    </from>
                    <to>$BPTypeHierarchyOperationOut/ns1:person/ns1:address/@xsi:type</to>
                </copy>
                <copy>
                    <from>
                        <literal>ns0:EmployeeType</literal>
                    </from>
                    <to>$BPTypeHierarchyOperationOut.part1/@xsi:type</to>
                </copy>


Issue - 3
Mapper fails to render "Assign1" & "Assign2", but it is fine with "if".

Issue - 4
It reprots 5 errors and 2 warnings. It should be 0 errors and 0 warnings.


XML validation started.

C:/OpenESB/head/open-jbi-components/driver-tests/bpelse/assign/TypeHierarchy/src/BPTypeHierarchy.bpel:132,16
WARNING: Currently the Sun BPEL SE does not support types for XML attributes.

C:/OpenESB/head/open-jbi-components/driver-tests/bpelse/assign/TypeHierarchy/src/BPTypeHierarchy.bpel:138,16
WARNING: Currently the Sun BPEL SE does not support types for XML attributes.

C:/OpenESB/head/open-jbi-components/driver-tests/bpelse/assign/TypeHierarchy/src/BPTypeHierarchy.bpel:147,12
ERROR: BooleanExpr: Can not find the element "ns0:empId" at the namespace "http://xml.netbeans.org/examples/EmployeeNS".
Expression: "$BPTypeHierarchyOperationOut.part1/ns0:empId = '100'"

C:/OpenESB/head/open-jbi-components/driver-tests/bpelse/assign/TypeHierarchy/src/BPTypeHierarchy.bpel:84,16
ERROR: To: Can not find the element "ns2:city" at the namespace "http://xml.netbeans.org/examples/AddressNS".
Expression: "$BPTypeHierarchyOperationOut.part1/ns1:address/ns2:city"

C:/OpenESB/head/open-jbi-components/driver-tests/bpelse/assign/TypeHierarchy/src/BPTypeHierarchy.bpel:108,16
ERROR: To: Can not find the element "ns2:zip" at the namespace "http://xml.netbeans.org/examples/AddressNS". Expression:
"$BPTypeHierarchyOperationOut.part1/ns1:address/ns2:zip"

C:/OpenESB/head/open-jbi-components/driver-tests/bpelse/assign/TypeHierarchy/src/BPTypeHierarchy.bpel:96,16
ERROR: To: Can not find the element "ns2:state" at the namespace "http://xml.netbeans.org/examples/AddressNS".
Expression: "$BPTypeHierarchyOperationOut.part1/ns1:address/ns2:state"

C:/OpenESB/head/open-jbi-components/driver-tests/bpelse/assign/TypeHierarchy/src/BPTypeHierarchy.bpel:159,20
ERROR: To: Can not find the element "ns2:note" at the namespace "http://xml.netbeans.org/examples/AddressNS".
Expression: "$BPTypeHierarchyOperationOut.part1/ns1:address/ns2:note"
Comment 1 Murali Pottlapelli 2008-11-16 23:23:48 UTC
Created attachment 73807 [details]
Project to reproduce issue
Comment 2 ggenipudi 2008-11-18 18:29:34 UTC
Raising priority since this is a regression from earlier builds.
Comment 3 Nikita Krjukov 2008-11-18 23:33:48 UTC
I'm not sure I understood "Issue -2 It generates redundant copy statements in Assign2"
Where is the redundancy? 
Comment 4 Nikita Krjukov 2008-11-18 23:34:16 UTC
Here is a result of investigation:
This issue is a combination of 3 different problems: 

1. The BPEL XPath validation uses the TypeCast and PseudoComp extensions only in case of Assign-->Copy
   Small amount of work (<1day) required to fix it. It appears only in validation. 
   See "Can not find the element "ns0:empId" in the ..." in the validation results above.

2. There is a small bug with generating XPath:  
      $BPTypeHierarchyOperationOut/ns1:person/ns1:address/ 
   shoudl be 
      $BPTypeHierarchyOperationOut.part1/ns1:address/ 
   It's very simple and I already fixed it locally. 

3. Problem with nested TypeCast declarations. 
It is most difficult and massive. It is necessary to rewrite big amount of classes. 
Fortunately the job already has been started. But it was suspended some time. 
It was considered as a feature. See issue #149532 
Comment 5 Sergey Lunegov 2008-11-19 13:02:27 UTC
It's not a regression and not even the bug. It's feature. "TypeCast" feature has a lot of particular cases. This one
wasn't implemented. I'll keep it as DEFECT just to keep it visible.
Comment 6 Nikita Krjukov 2008-11-19 18:05:50 UTC
I pushed a fix for generating a correct XPath to soa-dev
http://hg.netbeans.org/soa-dev/rev/fd3505c33884
Comment 7 Nikita Krjukov 2008-12-05 14:45:31 UTC
Partly fixed the problem #3 - with nested type casts. 
   http://hg.netbeans.org/soa-dev/rev/80ecc126d698  -- it was affected about 100 files
   http://hg.netbeans.org/soa-dev/rev/6f5555fb9bb8

The SropResolvingException can appear sometime. It should be hidden later. 
I use it in debugging purposes. 
Comment 8 Nikita Krjukov 2008-12-06 00:44:17 UTC
One more changes at soa-dev http://hg.netbeans.org/soa-dev/rev/63812abca0a7
Comment 9 Nikita Krjukov 2008-12-08 23:43:25 UTC
One more changes to soa-dev http://hg.netbeans.org/soa-dev/rev/605bfad9d371
Comment 10 Nikita Krjukov 2008-12-09 23:58:43 UTC
One more changes to soa-dev: http://hg.netbeans.org/soa-dev/rev/2168629e455d
Comment 12 Nikita Krjukov 2008-12-11 23:37:47 UTC
Predicates' editing should work now. 
Changeset: http://hg.netbeans.org/soa-dev/rev/d9ed985701cc
Comment 13 Nikita Krjukov 2008-12-12 13:43:35 UTC
Prevents typecast of attribute to complex type 
http://hg.netbeans.org/soa-dev/rev/ec1546125a2d
Comment 14 Vitaly Bychkov 2008-12-12 14:37:39 UTC
Fix bpel model sync issue while editing editor extension element from source.
http://hg.netbeans.org/soa-dev/rev/09e9acc51a79
Comment 15 Nikita Krjukov 2008-12-12 17:12:38 UTC
Prevent validation errors http://hg.netbeans.org/soa-dev/rev/7dcdbc637258
Comment 16 Nikita Krjukov 2008-12-12 21:56:06 UTC
Corrected Predicate Editor http://hg.netbeans.org/soa-dev/rev/1305e1332ecb
Comment 17 Nikita Krjukov 2008-12-12 22:20:42 UTC
all known problem are fixed
Comment 18 Murali Pottlapelli 2008-12-13 09:48:48 UTC
I am using sierra_1961_20081213_0541.zip, there is still issue with generation of xsi:type attribute. I have created
project from scratch using the person, address and employee schema documents. Project is attached.


Comment 19 Murali Pottlapelli 2008-12-13 09:49:59 UTC
Created attachment 74919 [details]
new project to demonstrate the issue
Comment 20 Murali Pottlapelli 2008-12-13 09:56:32 UTC
It should generate two copy statements with @xsi:type as there are two type casts.
            <copy>
                <from>
                    <literal>ns2:USAddressType</literal>
                </from>
                <to>$BPTypeHierarchyOperationOut.part1/ns1:address/@xsi:type</to>
            </copy>
            <copy>
                <from>
                    <literal>ns0:EmployeeType</literal>
                </from>
                <to>$BPTypeHierarchyOperationOut.part1/@xsi:type</to>
            </copy>
Comment 21 Murali Pottlapelli 2008-12-13 10:02:13 UTC
Validation reports
C:/temp/NZTelecom/TypeHierarchy/src/TypeHierarchy.bpel:110,9
WARNING: The types of "From" and "To" activities are different: "string" and "token".

At line 110  there is nothing else other than <copy>

So warning is not right.
Comment 22 Nikita Krjukov 2008-12-15 16:49:56 UTC
Small changes with toString() method 
http://hg.netbeans.org/soa-dev/rev/7538b9353b22
Comment 24 Nikita Krjukov 2008-12-15 19:33:01 UTC
Created attachment 74980 [details]
Corrected initial project
Comment 25 Nikita Krjukov 2008-12-15 19:33:38 UTC
Created attachment 74981 [details]
Another one corrected project.
Comment 26 Nikita Krjukov 2008-12-15 22:08:56 UTC
New changesets:
    http://hg.netbeans.org/soa-dev/rev/287f00d95359
    http://hg.netbeans.org/soa-dev/rev/311d7e9f69be


Don't you think it well enough to consider it fixed and consider another errors as separate issues? 

Comment 27 Alexander Permyakov 2008-12-17 11:58:05 UTC
New changesets:
to add right prefix  
http://hg.netbeans.org/soa-dev/rev/12f62d62e6f3 
Comment 28 Nikita Krjukov 2008-12-22 15:03:52 UTC
The issue #155941 describes a side effect caused by the fix of this issue. 
It probably should be taken into account in case of migrating this issue to another branch. 
Comment 29 Murali Pottlapelli 2008-12-24 01:09:41 UTC
Few more issues.
1. When a node is "cast to", name space definitions are added to account for the "Process" element, but corresponding
<import>s are not added. This makes run time fail with. Project is attached, to reproduce the issue. un-comment imports
it would work.

[#|2008-12-23T16:09:27.644-0800|WARNING|sun-appserver9.1|com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.BPELProcessInstanceImpl|_ThreadID=45;_ThreadName=BPELSEInOutThread6;_RequestID=e3428a67-276e-48df-9791-84ee98fdcb24;|BPCOR-6151:The
process instance has been terminated because a fault was not handled; Fault Name is
{http://docs.oasis-open.org/wsbpel/2.0/process/executable}invalidVariables; Fault Data is null
com.sun.jbi.engine.bpel.core.bpel.exception.StandardException: BPCOR-6175:Invalid document 
<?xml version="1.0" encoding="UTF-8" standalone="no"?><jbi:message
xmlns:msgns="http://j2ee.netbeans.org/wsdl/TypeHierarchy/TypeHierarchy" type="msgns:TypeHierarchyOperationResponse"
version="1.0" xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"><jbi:part><ns1:person
xmlns:ns0="http://xml.netbeans.org/examples/EmployeeNS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns0:EmployeeType"
xmlns:ns1="http://localhost/person"><ns1:firstName>John</ns1:firstName><ns1:lastName>Doe</ns1:lastName><ns1:address
xmlns:ns2="http://xml.netbeans.org/examples/AddressNS" xsi:type="ns2:USAddressType"><ns2:name>John
Doe</ns2:name><ns2:street>800 Royal
Oaks</ns2:street><ns2:city>Monrovia</ns2:city><ns2:state>CA</ns2:state><ns2:zip>91016</ns2:zip></ns1:address><ns0:department>CS</ns0:department><ns0:empId>100</ns0:empId></ns1:person></jbi:part></jbi:message>
is assigned to TypeHierarchyOperationOut in BP instance (10.0.237.249:3f2e28db:11e6620b6fd:-7f44) at line 28 BP
{http://enterprise.netbeans.org/bpel/TypeHierarchy/TypeHierarchy}TypeHierarchy
BPCOR-6129:Line Number is 28
BPCOR-6130:Activity Name is Assign1
	at com.sun.jbi.engine.bpel.core.bpel.engine.impl.BPELInterpreter.createVirtualFaultUnit(BPELInterpreter.java:234)
	at com.sun.jbi.engine.bpel.core.bpel.engine.impl.BPELInterpreter.execute(BPELInterpreter.java:202)
	at com.sun.jbi.engine.bpel.core.bpel.engine.BusinessProcessInstanceThread.execute(BusinessProcessInstanceThread.java:98)
	at com.sun.jbi.engine.bpel.core.bpel.engine.impl.BPELProcessManagerImpl.process(BPELProcessManagerImpl.java:1046)
	at com.sun.jbi.engine.bpel.core.bpel.engine.impl.EngineImpl.process(EngineImpl.java:278)
	at com.sun.jbi.engine.bpel.core.bpel.engine.impl.EngineImpl.process(EngineImpl.java:1293)
	at com.sun.jbi.engine.bpel.BPELSEInOutThread.processRequest(BPELSEInOutThread.java:451)
	at com.sun.jbi.engine.bpel.BPELSEInOutThread.processMsgEx(BPELSEInOutThread.java:262)
	at com.sun.jbi.engine.bpel.BPELSEInOutThread.run(BPELSEInOutThread.java:193)
Caused by: com.sun.xml.transform.sware.MissingSchemaInfoException: Cannot find the XML type definition in the schema
type system: {http://xml.netbeans.org/examples/EmployeeNS}EmployeeType
	at com.sun.xml.transform.sware.impl.ReorderTransformerImpl.transform(ReorderTransformerImpl.java:154)
	at com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.AssignUnitImpl.transformDocument(AssignUnitImpl.java:471)
	at
com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.AssignUnitImpl.validateOrAndTransformVariable(AssignUnitImpl.java:402)
	at com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.AssignUnitImpl.doAction(AssignUnitImpl.java:334)
	at com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.CodeReUseHelper.executeChildActivities(CodeReUseHelper.java:65)
	at
com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.StructuredActivityUnitImpl.executeChildActivities(StructuredActivityUnitImpl.java:193)
	at
com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.StructuredActivityUnitImpl.doAction(StructuredActivityUnitImpl.java:93)
	at com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.SequenceUnitImpl.doAction(SequenceUnitImpl.java:95)
	at com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.CodeReUseHelper.executeChildActivities(CodeReUseHelper.java:65)
	at
com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.StructuredActivityUnitImpl.executeChildActivities(StructuredActivityUnitImpl.java:193)
	at com.sun.jbi.engine.bpel.core.bpel.model.runtime.impl.BPELProcessInstanceImpl.doAction(BPELProcessInstanceImpl.java:650)
	at com.sun.jbi.engine.bpel.core.bpel.engine.impl.BPELInterpreter.execute(BPELInterpreter.java:147)
	... 7 more
|#]

2. I could access nodes in the derived type EmployeeType & USAddressType on TypeHierarchyOperationOut variable in
Assign2 with no explicit cast operation. It looks like retains the type cast from Assign1, but it is not the case for IF
condition.

3. Assign2, it generates redundant <copy> statements for @xsi:type. 
Comment 30 Murali Pottlapelli 2008-12-24 01:12:36 UTC
Created attachment 75288 [details]
Project attached on Dec 23 demonstrate new issues
Comment 31 lucica 2009-01-19 08:31:05 UTC
The assignment of the attribute of derived type is not working. 

1. In the project testProject-bp.zip select CreateService operation of external WSDL.
2. Do 'cast' to the request->service->subscriber->attributes->ct_attribute. Select singlevalue or multivalue.
3. You'll see now that the 'derived type' has additional attributes and element.
4. Map the attributes
5. Switch to designer view, there are errors on Assign3 components
6. Switch back to the mapper, the assignments done before are removed
7. However the problematic code is not removed from source code

OpenESB Nightly build 08.01.2009
Comment 32 Nikita Krjukov 2009-01-22 23:27:42 UTC
I fixed the problem described by Lucia to soa-dev.
Here is the changeset: http://hg.netbeans.org/soa-dev/rev/63d5c4f020e0
Comment 33 Nikita Krjukov 2009-01-22 23:34:21 UTC
Created attachment 76166 [details]
The mentioned project testProject-bp. It is a bit corrected here.
Comment 34 Nikita Krjukov 2009-01-26 14:13:52 UTC
It turned out the same problem like has been found by Lucia with TypeCast exists for another Location Step Modifiers
(LSM) - Predicates and Pseudo Components. Here is a small fix: http://hg.netbeans.org/soa-dev/rev/8379b867b083
Comment 35 Nikita Krjukov 2009-01-29 22:22:01 UTC
The issue #157553 has important fixes related to the functionality covered by this issue. 
It should be taken into account while partial migration to another branch!
Comment 36 Nikita Krjukov 2009-04-10 20:25:09 UTC
Close it because all issues it depends on are fixed. 
Comment 37 terrybraun 2009-04-23 23:32:55 UTC
QA: This ticket documents many issues which have been opened, fixed, opened, and fixed. The current build appears to be 
stable and consistent with the desired state.

Therefore, this ticket is varified with the NetBeans IDE 6.5.1 (Build 200904151427). Further issues will be documented 
with new tickets.