How do I serialize and persist an MTree to file?

How do I serialize and persist an MTree to file?

book

Article ID: KB0085337

calendar_today

Updated On:

Products Versions
TIBCO Adapter SDK -
Not Applicable -

Description

Resolution:
With SDK 5.x, you can persist data by using xml document.
Steps are the following;

Serialize
=========
String MInstance.toXML();

Deserialize
===========
MTree(String, int); // specific as XML
void MTree.setTextBody(String);
MData MDataFactory.newData(MTree tree);

The preservation is data only - not state.

There's no supported method in 3.x and 4.x, that can be used to serialize and persist an MTree to file. If the expectation is to be able to recreate an MTree from the persisted copy, we also strongly recommend against it since the process used to persist an MTree may not preserve all original information required to recreate the MTree. Instead, we would recommend the user to iterate and retrieve individual fields and save the values, or to take advantage of the existing TIBCO Adapter for File.

Issue/Introduction

How do I serialize and persist an MTree to file?