#162 Custom class in example doesn't work

None
closed-fixed
nobody
None
5
2013-01-06
2012-08-17
James Agnew
No

Per an email on the mailing list from Michael Connor.

----

private void init(ModelClassFactory factory) {

try {

this.add(MSH.class, true, false);

this.add(SFT.class, false, true);

this.add(DRG.class, false, false);

this.add(ADT_A01_PROCEDURE.class, false, true);

this.add(GT1.class, false, true);

this.add(ADT_A01_INSURANCE.class, false, true);

this.add(ACC.class, false, false);

..

But then uses just INSURANCE and PROCEDURE when referencing:

public ADT_A01_INSURANCE getINSURANCE() {

return getTyped("INSURANCE", ADT_A01_INSURANCE.class);

}

It can do this because AbstractGroup.getName() strips off the group’s message’s name from the beginning of the name if it matches (“ADT_A01_INSURANCE” becomes “INSURANCE”). But this won’t be the case for a subtype of ADT_A01_ (e.g. as in the CustomModelClasses example, where it is ZDT_A01). So, for a ZDT_A01 that is a subtype of ADT_A01, ADT_A01_INSURANCE gets mapped to “ADT_A01_INSURANCE”, rather than “INSURANCE”. Subsequently a call to getINSURANCE(), which uses the short name, returns a null.

Discussion

  • James Agnew

    James Agnew - 2012-08-17

    See CustomModelClassTest for example

     
  • Christian Ohr

    Christian Ohr - 2012-11-30

    committed solution proposal

     
  • James Agnew

    James Agnew - 2013-01-06
    • status: open --> closed-fixed
    • milestone: -->
     
  • James Agnew

    James Agnew - 2013-01-06

    Verified fixed.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks