In the context of cloning a ListQueryExpression I tried serializing and deserializing the object. I've come to the conclusion, that the list (and count) is already lost after serialization.
In the following code:
define variable lListQueryExpression as Consultingwerk.ListQueryExpression no-undo.
define variable lListQueryExpression2 as Consultingwerk.ListQueryExpression no-undo.
define variable lOutputStream as Consultingwerk.LongcharOutputStream no-undo.
define variable lSerializer as Progress.IO.JsonSerializer no-undo.
define variable lInputStream as Consultingwerk.LongcharInputStream no-undo.
lListQueryExpression = new Consultingwerk.ListQueryExpression().
lListQueryExpression:add(new Consultingwerk.QueryExpression("eTable.Field", Consultingwerk.OperatorEnum:GE, "Test")).
// Serialize lListQueryExpression
lOutputStream = newConsultingwerk.LongcharOutputStream().
lSerializer = new Progress.IO.JsonSerializer (true).
lSerializer:Serialize(lListQueryExpression, lOutputStream).
lOutputStream:Close().
// Deserialize lListQueryExpression in lListQueryExpression2
lInputStream = new Consultingwerk.LongcharInputStream(lOutputStream:getLongchar()).
lListQueryExpression2 = CAST(lSerializer:Deserialize(lInputStream), Consultingwerk.ListQueryExpression).
message lListQueryExpression:count lListQueryExpression:GetExpression() skip
lListQueryExpression2:count lListQueryExpression2:GetExpression()
view-as alert-box.
I would assume that Count and GetExpression would give the same results for lListQueryExpression and lListQueryExpression2, as lListQueryExpression2 is the deserialized version of serialized lListQueryExpression.
This is not the case. The serialized version of lListQueryExpression only has ListHash and Operator as properties, but not oList and iCount.
After changing GenericList.cls to include the serializable keywords for oList and iCount as follows it does work:
DEFINE {&SERIALIZABLE} variable oList AS Progress.Lang.Object NO-UNDO extent.
DEFINE {&SERIALIZABLE} variable iCount AS INTEGER NO-UNDO INITIAL 0.
@CW: Do you want me to create a case for this?
Can anyone find a reason why this isn't needed for Progress' native serialization when passing the PASOE border?
Last modified on 12 Jan 2022 14:01 by Bert Strobbe