Question
Lanit
RU
Last activity: 7 Oct 2015 9:09 EDT
XML incorrect data filling
Hello everyone!
We have an integration where we need to send date, decimal, boolean values.
What we do:
1. Create a page of int data class.
2. Fill it with the values in Data transform.
3. Run XML Stream.
What we get:
Empty elements of data types listed above when corresponding properties do not exist in work object. XML does not pass XSD validation because of empty elements (decimal e.g.).
Documentation for XML Stream says:
Is Optional? - Select this option to prevent the element or attribute from being added to the generated XML stream content when there is no clipboard data to be mapped.
This option does not prevent empty elements to be created. What can we do to prevent creation of these empty elements?
I've created an SR for this problem, but maybe here I'll get an answer faster.
Data transform:
Hello everyone!
We have an integration where we need to send date, decimal, boolean values.
What we do:
1. Create a page of int data class.
2. Fill it with the values in Data transform.
3. Run XML Stream.
What we get:
Empty elements of data types listed above when corresponding properties do not exist in work object. XML does not pass XSD validation because of empty elements (decimal e.g.).
Documentation for XML Stream says:
Is Optional? - Select this option to prevent the element or attribute from being added to the generated XML stream content when there is no clipboard data to be mapped.
This option does not prevent empty elements to be created. What can we do to prevent creation of these empty elements?
I've created an SR for this problem, but maybe here I'll get an answer faster.
Data transform:
XML Stream:
XSD:
Result XML:
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
PEG
IN
May I know PRPC version?
Lanit
RU
It is 7.1.8.
Build coreAssemblyCached_718_675_filtered
PEG
IN
Did you check whether below DSS is present or not? If not , please create a one and give it a try.
Owning Ruleset : Pega-IntegrationEngine
Purpose : StreamXML/DetectEmptyProperties
Value : true
Lanit
RU
I've created this DSS and resaved XML Stream rules.Result XML now doesn’t contain empty boolean, integer, decimal fields. But there are still empty dates.
PEG
IN
Date properties I need to check in house. If I get some time I will try and update you accordingly.
PEG
IN
I just checked in ML8 with DSS set to true. Date properties aren't showing. In ML9 it is working as expected without DSS also.
Without optional checkbox enabled.
Lanit
RU
PEG
IN
PEG
IN
PRPC version screenshot
BuildName |
coreAssemblyCached_718_675 |
BuildDate |
2015-05-20 18.49 EDT |
Lanit
RU
Can you send your test application so I can try it on my environment?
PEG
IN
Use below XSD to create data mapping rules using Connector&Metadata wizard.
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xml.msdw.com/ns/appmw/eclipse/2.0" xmlns:tns="http://xml.msdw.com/ns/appmw/eclipse/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employee" type="fullpersoninfo"/>
<xs:complexType name="personinfo" abstract="true">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="JoiningDate" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Use below XSD to create data mapping rules using Connector&Metadata wizard.
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://xml.msdw.com/ns/appmw/eclipse/2.0" xmlns:tns="http://xml.msdw.com/ns/appmw/eclipse/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="employee" type="fullpersoninfo"/>
<xs:complexType name="personinfo" abstract="true">
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="JoiningDate" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="fullpersoninfo">
<xs:complexContent>
<xs:extension base="tns:personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
2.Change the JoiningDate element node field to optional and run the XML Stream rule.
Hope it helps!
Lanit
RU
JoiningDate here is filled with "".
In my case we fill date from another date which can have value and can have no value. If there is no value in source date property, we get 19700101 in target property.
PEG
IN
In any case your date property will have value. Right?
Lanit
RU
No, in my case source property does not exist.
PEG
IN
May I know the SR number? I'll check the SR notes if possible.
Lanit
RU