Question
Labb Consulting
NL
Last activity: 28 Mar 2018 4:42 EDT
How Substitution Work for XML Stream Rule
What XSD Contains:
<element name="Position" type="tns:PositionType"/>
<element name="Creation" type="tns:Creation" substitutionGroup="tns:Position"/>
<element name="Change" type="tns:Change" substitutionGroup="tns:Position">
And XSD Defines PositionType as abstract type as below
<complexType name="PositionType" abstract="true">
Now when we are running the wizard, pega is creating below
Position XML stream rule in VDF-Int-COM-PositionType class for element Position with root tag as OrderPosition
Position XML stream rule in VDF-Int-COM-Creation class for element Creation with root tag as Creation
Position XML stream rule in VDF-Int-COM-Change class for element Change with root tag as Change
with Position PageList Type Property created with Page “VDF-Int-COM-PositionType”.
What XSD Contains:
<element name="Position" type="tns:PositionType"/>
<element name="Creation" type="tns:Creation" substitutionGroup="tns:Position"/>
<element name="Change" type="tns:Change" substitutionGroup="tns:Position">
And XSD Defines PositionType as abstract type as below
<complexType name="PositionType" abstract="true">
Now when we are running the wizard, pega is creating below
Position XML stream rule in VDF-Int-COM-PositionType class for element Position with root tag as OrderPosition
Position XML stream rule in VDF-Int-COM-Creation class for element Creation with root tag as Creation
Position XML stream rule in VDF-Int-COM-Change class for element Change with root tag as Change
with Position PageList Type Property created with Page “VDF-Int-COM-PositionType”.
Now when the above XML stream rule is getting referred from Main root XML stream rule as the Position property is of type class VDF-Int-COM-PositionType its referring to the abstract type XML stream rule it means the tag name will be Position but external System is expecting Change as tag name in this case.
Now I have one solution to update the Position property to class VDF-Int-COM-Change and it will start referring the correct XML stream rule. But this will lead to problem when we will import next version of the XSD, pega will again create the property which will start referring again to VDF-Int-COM-PositionType and we need to update it manually again.
Is the above is Pega recommended way if not how should we configure it?
***Updated by moderator: Lochan to add Categories; add SR details***