Universal Messaging Developer Guide : Web Client APIs : Web Developer's Guide for Adobe Flex : Publish / Subscribe using Datastreams and Datagroups : Creating and Deleting DataGroups
Creating and Deleting DataGroups
Creating Universal Messaging DataGroups
nDataGroups can be created programmatically as detailed below, or they can be created using the Enterprise Manager.
In order to create a nDataGroup, first of all you must create an nSession object, which is effectively the logical and physical connection to a Universal Messaging Realm. This is achieved by using an RNAME for your Universal Messaging Realm when constructing the nSessionAttributes object, as shown below:

var RNAME : String = "nhp://nirvanahost:80";
var username : String = "myUserName";
var appName : String = "MyApplicationName";
var attributes : nSessionAttributes = new nSessionAttributes(RNAME,5);
var mySession : nSession = nSessionFactory.create(attributes, username,
appName, errorCB);
mySession.init(sessionInitCallback, connectionListener);
Once the nSession.init() method is successfully called, your connection to the realm will be established.
Using the nSession object instance mySession, you can then create DataGroups.
Create a nDataGroup

mySession.createDataGroup("myGroup", dataGroupsCallback);
Create multiple nDataGroups

var groups : Array = ["myFirstGroup", "mySecondGroup"];
mySession.createDataGroups(groups, dataGroupsCallback);
Now we will get a call back to dataGroupsCallback and have a reference to the Universal Messaging datagroup(s) within the realm or an error.
Creating DataGroups with DataGroupListeners and ConflationAttributes
It is also possible to specify additional properties when creating DataGroups:
*nDataGroupListener - To specify a listener for DataGroup membership changes (see Managing DataGroup Membership).
*nConflationAttributes - To specify attributes which control event merging and delivery throttling for the DataGroup (see DataGroup Conflation Attributes).
Now we have a reference to a Universal Messaging DataGroup it is possible to publish events.
Deleting Universal Messaging DataGroups
There are various deleteDataGroup methods available on nSession which will delete DataGroups. It is possible to specify single nDataGroups or arrays of nDataGroups.
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback