Issue 51: Issue in deserialization from XML to AS3 object.
Status:  Verified
Owner:
Closed:  Aug 2011
Reported by rashmira...@gmail.com, Aug 18, 2011
What steps will reproduce the problem?
1. var servVo:Service = FlexXBEngine.instance.deserialize(prefsXML, Service);
Where prefsXML : <Service description="Air pollution measurement and alrm service" name="S1-TAG_00000330-E01-01">
  <entry xsi:type="deviceEntry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <position x="1"/>
    <scdId>test</scdId>
    <tagId>tagId1</tagId>
    <tagDataType>1</tagDataType>
  </entry>
  <eventRule xsi:type="SingleRange" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <name>test</name>
    <defaultActionFlowId>defaultActionFlowId1</defaultActionFlowId>
    <position x="1"/>
    <condition>
      <lowerOperator></lowerOperator>
      <lowerValue>1000</lowerValue>
      <upperOperator></upperOperator>
      <upperValue></upperValue>
      <sgpEventId>DCA00000001</sgpEventId>
      <actionFlowId>actionFlowId01</actionFlowId>
    </condition>
    <interruptTagId>interruptId1</interruptTagId>
  </eventRule>
  <actionFlow id="actionFlowId01" invokeCondition="true">
    <action descriptionKr="SMS? ??? ??" descriptionEn="Send sms messages" xsi:type="SmsAction" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <name>testaction</name>
      <actionFlow id="innerActFlowId01" invokeCondition="true">
        <action descriptionKr="E-mail? ??? ??" descriptionEn="Send e-mails" xsi:type="EmailAction">
          <name>testInnerAction</name>
        </action>
        <action descriptionKr="SMS? ??? ??" descriptionEn="Send sms messages" xsi:type="SmsAction">
          <name>testInnerSMSAction</name>
        </action>
      </actionFlow>
    </action>
  </actionFlow>
</Service>

2. After deserialization, i should have service object (AS3). Which should have DeviceEntry of type Entry,SingleRange of type EventRule and ArrayList of ActionFlow which contains again ArrayList of Action.
 
3. But after deserialize, its giving Entry, EventRule and not giving the List of ActionFlow and Actions.

What is the expected output? What do you see instead?

After deserialization, i should have service object (AS3). Which should have DeviceEntry of type Entry,SingleRange of type EventRule and ArrayList of ActionFlow which contains again ArrayList of Action.

in my XML, i have XMLElement Entry whose xsiType is DeviceEntry, so while desirilize i should get DeviceEntry object of Entry type, and while deserilizing ArrayList of ActionFlow i should get ArrayList of ActionFlow objects and so on. 
What version of the product are you using? On what operating system?

FlexXb 2.x

Please provide any additional information below.

Please find the attached files related to Service Vo and the respective classes.

Thanks in advance.
service.zip
25.7 KB   Download
Aug 19, 2011
Project Member #1 alex.id....@gmail.com
In the Service class make sure the alias for the XmlArray metadata is set to * since you do not have a actionFlowList wrapper element around your actionFlow items.

The second problem is related with ArrayList handling and it has already been fixed and on SVN. 

A release containing this fix and some others will be delivered soon.

Status: Fixed
Aug 19, 2011
#2 rashmira...@gmail.com
Thanks Alex,

Thanks for your response. As i have already mentioned in the earlier post, I have Entry as my parent class and DeviceEntry as my child class that extends Entry. That is represented in xml as  "<entry xsi:type="deviceEntry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <position x="1"/>
    <scdId>test</scdId>
    <tagId>tagId1</tagId>
    <tagDataType>1</tagDataType>
  </entry>" in my service.xml, but while deserializing the service.xml, i am getting Entry Object, i should get DeviceEntry object of type Entry.

Can you please provide some solution on this.

Thanks in advance.

Aug 19, 2011
#3 rashmira...@gmail.com
Thanks Alex,

Thanks for your response. As i have already mentioned in the earlier
post, I have Entry as my parent class and DeviceEntry as my child
class that extends Entry. That is represented in xml as  "<entry
xsi:type="deviceEntry"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <position x="1"/>
    <scdId>test</scdId>
    <tagId>tagId1</tagId>
    <tagDataType>1</tagDataType>
  </entry>" in my service.xml, but while deserializing the
service.xml, i am getting Entry Object, i should get DeviceEntry
object of type Entry.

Can you please provide some solution on this.


Thanks & Regards,

Rashmi Ranjan Dash
(+91 ) 9538249751
Aug 19, 2011
Project Member #4 alex.id....@gmail.com
oops, sorry about the misunderstanding. I'll look into it
Status: Accepted
Aug 19, 2011
Project Member #5 alex.id....@gmail.com
Make sure you are processing teh derived types in advance because there is no way for FlexXB to know on deserialization about tha type if it wasn't processed before.
Use FlexXBEngine.instance.processTypes(DeviceEntry) somewhere at the beginning.
Aug 21, 2011
#7 rashmira...@gmail.com
Thanks Alex..
Thanks for your reply. Its working now.
Aug 22, 2011
Project Member #8 alex.id....@gmail.com
(No comment was entered for this change.)
Status: Fixed
Labels: Milestone-2.3.0
Apr 14, 2012
Project Member #9 alex.id....@gmail.com
(No comment was entered for this change.)
Status: Verified
Owner: alex.id....@gmail.com