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.
See CustomModelClassTest for example
committed solution proposal
Verified fixed.