String sNodeName = derivedMapping.getNodeName();
boolean bAppendType = false;
if (obj == null && part.isRequired())
{
throw new IntegrationException("err.integration.minPartCount", new Object[]{part.getFullPath()});
}
if (obj != null && part instanceof CompositeMessagePart)
{
TransferObject tobj = (TransferObject)obj;
String sDerivedMessageName = tobj.getClassName();
if (!StringUtil.isEmpty(sDerivedMessageName))
{
Message derivedMessage = m_context.getMetadata().getMessage(sDerivedMessageName);
Message baseMessage = null;
if (parentPart == null) // root of message (includes root part referencing another message)
{
baseMessage = ((RootXMLMessagePartMapping)part.getRoot().getMapping()).getRootMessage();
}
else if (part instanceof CompositeMessagePartRef)
{
CompositeMessagePart referencedPart = ((CompositeMessagePartRef)part).getRefPart();
baseMessage = ((RootXMLMessagePartMapping)referencedPart.getMapping()).getRootMessage();
}
if (baseMessage != null)
{
Message.validatePolymorphism(baseMessage, derivedMessage, part);
if (baseMessage != derivedMessage)
{
part = derivedMessage.getRoot();
bAppendType = true;
derivedMapping = (XMLMessagePartMapping)part.getMapping();
}
}
}
}
if (((RootXMLMessagePartMapping)part.getRoot().getMapping()).getRootMessage().getDerivation() == Message.DERIVATION_ABSTRACT)
{
throw new IntegrationException("err.integration.abstractMessage",
new Object[]{((RootXMLMessagePartMapping)part.getRoot().getMapping()).getRootMessage().getName(), part.getFullPath()});
}
if (part instanceof CompositeMessagePart)
{