Nirvana VBA : Event Properties

A Nirvana 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.

Nirvana 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.

Share this page with others:
Tell Your Tweets Facebook It! Add to Delicious Reddit! Digg It! Stumble Upon Add to Your Faves Mixx it
Follow Us:
Keep up with my-Channels on Twitter Become a fan on Facebook LinkedIn Profile Recent Highlights RSS Feed