Topic
  • 3 replies
  • Latest Post - ‏2013-05-08T04:04:05Z by vradhik
elterrible
elterrible
2 Posts

Pinned topic Extending XML schema

‏2011-11-11T18:26:37Z |
Hello everybody,

today I tried to extend DWLCustomer.xsd schema of MDM interface (DataStewardship). I only needed to add LastVerifiedDate into TCRMSuspectPersonBObj,
because it is present in the schema of MDM and appears sometimes in MDM response (when not null), breaking response parsing in the interface.

Following the instructions, I generated DWLCustomer.genmodel file, and then SDO objects. But after that response parser for TCRMSuspectPersonBObj fails
with exceptions like this
Caused by: java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EAttributeImpl incompatible with org.eclipse.emf.ecore.EReference
at com.dwl.customer.impl.CustomerPackageImpl.getTCRMSuspectPersonBObjType_TCRMPersonNameBObj(CustomerPackageImpl.java:46032)

What have I missed there ?

As I can see, it happens due to shifted IDs of structural features in generated methods of CustomerPackageImpl:
public EReference getTCRMSuspectPersonBObjType_TCRMPersonNameBObj() {
return (EReference)getTCRMSuspectPersonBObjType().getEStructuralFeatures().get(69);
}

But why these features are still available via the old (non-shifted) IDs, not the new ones ?
Any hint would be appreciated ...
  • vradhik
    vradhik
    4 Posts

    Re: Extending XML schema

    ‏2013-05-06T13:43:59Z  

    Hi

    Did you find a solution to this?

    I have a similar issue.. the ID of the feature is right in my case. However, it seems like either the wrong routine in CustomerPackageImpl is called when I am calling a getSomeAttributeName() routine from the someExtensionBObjTypeImpl or the CustomerPackageImpl.getSomeExtensionBObjType_SomeAttributeName() routine  is evaluating to a wrong attribute.

    When I debug, the CustomerPackageImpl.getSomeExtensionBObjType_SomeAttributeName() routine  is not called and when I Inspect the value of getSomeExtensionBObjType().getSomeExtensionBObjType_SomeAttributeName().get(n) , it evaluates to a different attribute altogether. The attribute I am trying to get is a reference object attribute with maxOccurs="unbounded". The evaluated attribute when I Inspect the value in debug mode is a different String attribute with maxOccurs="1" which is why I am getting the ClassCastException.

    It seems like a bug to me..

    Any help is greatly appreciated. Thanks

    Using MDM9.0.2 with DSUI

    Updated on 2013-05-06T13:45:04Z at 2013-05-06T13:45:04Z by vradhik
  • elterrible
    elterrible
    2 Posts

    Re: Extending XML schema

    ‏2013-05-06T14:08:19Z  
    • vradhik
    • ‏2013-05-06T13:43:59Z

    Hi

    Did you find a solution to this?

    I have a similar issue.. the ID of the feature is right in my case. However, it seems like either the wrong routine in CustomerPackageImpl is called when I am calling a getSomeAttributeName() routine from the someExtensionBObjTypeImpl or the CustomerPackageImpl.getSomeExtensionBObjType_SomeAttributeName() routine  is evaluating to a wrong attribute.

    When I debug, the CustomerPackageImpl.getSomeExtensionBObjType_SomeAttributeName() routine  is not called and when I Inspect the value of getSomeExtensionBObjType().getSomeExtensionBObjType_SomeAttributeName().get(n) , it evaluates to a different attribute altogether. The attribute I am trying to get is a reference object attribute with maxOccurs="unbounded". The evaluated attribute when I Inspect the value in debug mode is a different String attribute with maxOccurs="1" which is why I am getting the ClassCastException.

    It seems like a bug to me..

    Any help is greatly appreciated. Thanks

    Using MDM9.0.2 with DSUI

    As I remember the problem in my case was caused by customer.ecore file which was not updated.

    Have you seen a copy of this file placed somewhere in java sources directory ? It goes then into jar file and processed in runtime.

    I had to update it manually, no idea why the framework do not do the job.

    HTH

  • vradhik
    vradhik
    4 Posts

    Re: Extending XML schema

    ‏2013-05-08T04:04:05Z  

    As I remember the problem in my case was caused by customer.ecore file which was not updated.

    Have you seen a copy of this file placed somewhere in java sources directory ? It goes then into jar file and processed in runtime.

    I had to update it manually, no idea why the framework do not do the job.

    HTH

    Thanks a lot for responding with your find! That was exactly the cause of my problem too. The customer.ecore in the model folder was updated whereas the one in java source was not. I copied the one in model folder to the java source and rebuilt,  that fixed it.