Universal Messaging 9.12 | Developer Guide | Enterprise APIs | Enterprise Developer's Guide for VBA | Publish / Subscribe | Learn More | Event Properties
 
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-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.