Universal Messaging Developer Guide : The Enterprise Client APIs : Overview of Developer's Guide for VBA : Publish / Subscribe : Learn More : Universal Messaging VBA : Event Properties
Universal Messaging VBA : Event Properties
A Universal Messaging Event (nConsumeEvent) can contain nEventProperties. This object contains key-value pairs in a similar way to a hash table and can also support nested nEventProperties.
Universal Messaging filtering allows subscribers to receive only specific subsets of a channel's events by applying the server's advanced filtering capabilities to the contents of each event's properties.
In this code snippet, we assume we want to publish an event containing a key called "myKey" with value "myValue"
Dim props As New nEventProperties
Call props.put("myKey", "myValue")

Dim evt As New nConsumeEvent
Call evt.init_2(props)

Call myChannel.Publish(evt)
The highlighted code shows the creation of the event properties.
Now say we want to add another set of properties within the properties we have just created. The code below highlight the extra code required to add a nested nEventProperties.

Dim props As New nEventProperties
Call props.put("myKey", "myValue")

Dim innerProps As New nEventProperties
Call innerProps.put("myInnerKey", "myInnerValue")

Call props.put_4("myDictName", innerProps)

Dim evt As New nConsumeEvent
Call evt.init_2(props)

Call myChannel.Publish(evt)
Here you see that the inner nEventProperties is created in exactly the same way and is then added to the outer nEventProperties in the same way that you would add a key-value pair with the value being the nEventProperties.
Copyright © 2013-2014 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback