Greetings
I am attempting to create a custom collection node to share some variables. A simple variable is not a problem, but I am having a problem with a value object. It seems I should be able to set the node name to be the name of the VO and the item name to be the property name and the body to be the property value. No matter what, the item name is "item", so you cannot store more than one property.
So for a CollectionNode named "testModel",
cnode.publish(new MessageItem("testInt", 1234), true);
will give (in Room Console)
CollectionNode: testModel
Node: testInt
Items: item -> body = 1234
That works fine.
if I do this:
cnode.publish(new MessageItem("testVO", 1111, "first"), true);
cnode.publish(new MessageItem("testVO", 2222, "second"), true);
I would expect:
CollectionNode: testModel
Node: testVO
Items: first -> body = 1111
Items: second -> body = 2222
But I actually get:
CollectionNode: testModel
Node: testVO
Items: item -> body = 2222
Views
Replies
Total Likes
Hi,
You nodeConfiguration for the node I believe is STORAGE_SCHEME_SINGLE_ITEM(which is the default). You should change it to STORAGE_SCHEME_MANUAL. Then you can publish different items on the node and it won't be overwritten. Currently, with single item , the id is always itemID and has only one value i.e the last value.
On storage scheme as manual , you can have different items with different itemIDs(specified by you) on the same node.
You can change the node configiuration of this node from the dev console(easier) or programmatically.
If you are doing programmatically, you should do something like this
var nodeConf:NodeConfiguration = new NodeConfiguration();
nodeConf.itemStorageScheme = NodeConfiguration.STORAGE_SCHEME_MANUAL;
collectionNode.createNode("testing",nodeConf);
Hope this helps.
Thanks
Hironmay Basu
Views
Replies
Total Likes
Excellent, that helps a lot!
I am actually creating the room from a template, so I'll just tweak that...
Views
Replies
Total Likes