Well, this is odd, and I can't exactly explain ALL of the ways to reproduce this issue, but I've found at least one way to reproduce this weirdness.
When connecting a Class constant to "Flatten to XML", it produces empty XML data. I would expect it to produce an XML representation of the default value of the Class, but it's empty. I could *maybe* accept that's intended behavior (though a weird, undocumented way of doing things) but the weird part is that, if you write the default value to the object, then flatten THAT to XML, it still doesn't work- but it doesn't work in a different way ![Smiley Happy Smiley Happy]()
I have attached a small example project in LV2016 to demonstrate, but hopefully the images will help. Not visible in these images is the class definition, which is a Numeric and a String. The default values for these are 42 and Hello, respectively. The accessors are the standard generated accessors, nothing special there.
Here we have 3 Flatten to XML functions:
![Block diagram.png Block diagram.png]()
The first flattens an Object constant to XML. The second writes a new value to the Numeric field, then flattens that to an XML. The third writes the default value back to the object, then flattens that to an XML.
Here is the result:
![Results.png Results.png]()
Only the second one worked, and the two that didn't work were slightly different to boot. The first one looks like it doesn't even try- the Version is all zeros. Writing a new value to the Numeric field, then flattening that, works as expected- even the String part, which was unused, came through as its default value. The weird part is that if you write the Numeric back to its default value, it stops working again, but this time it at least has the correct Version information.
I'm not quite sure how to get around this, other than to make sure I write at least some new value to the default Object.
Am I bonkers in assuming this is NOT expected behavior? I would have guessed the outputs to all three of these would be identical with the exception of the second one having a different value for the Numeric field.