Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Using objects in MessageDescriptors, strange behavior

Avatar

Level 3
Hello,



I have a bug i have trouble to track down.



We use a ShapeDescriptor with an optional property called
points as an Array.

If we publish an item with an array of Points objects
attached, i publish the message but the other user who should
receive it gets disconnected and reconnected (reconnect event).

If instead of an Array of Points, i send an Array of int the
message is received by the other and he does not get disconnected.



Can't we pass complex objects ? or i must have done something
completely wrong.

maybe public function createValueObject():Object in my
shapedescriptor can not encapsulate other objects as his parameters
?

Any hints are welcome, i will try some other tricks.



3 Replies

Avatar

Former Community Member
Hi ,

I have attached a small code below solving your problem
completely.

For passing any complexObject, you need to register it and
its any underlying classes as bodyClass. For more details, refer to
ComplexObjectTransfer example.

In this case, you will need to register the both the Point as
well as Array class. Normally , if you just pass array of
ints/strings, you don't need to register the Array as bodyClass,
but if you are passing complex objects in array, you will need to
register both the complex class as well as Array.



Here is the code solving your issue. I pass array of points
and also clear it

Avatar

Level 3
Shame on me,

I looked at the as files except the mxml registering body
classes.

Thanks

Avatar

Former Community Member
Complete code is attached now. Because of weird restriction
error in forum, it was taking time to attach the code in my
previous message.



Thanks

Hironmay Basu