Overview of the alternative method
When result viewers communicate with each other, typically one result viewer will publish an event and other result viewers will subscribe by listening for the published event. The result viewer that publishes the event is the publisher, and the result viewers that listen for the published event are the subscribers. For more information about the publishing and subscribing capabilities of the predefined result viewers, refer to Publishing and subscribing capabilities.
Keys
An event occurs when an item is selected in a publishing result viewer. When an event occurs, the publisher publishes a set of one or more keys that represent the selected item. Each key consists of a name/value pair and is used to help identify an instance of an entity. There is one key for each identity attribute in the publishing query. Keys are passed from a publisher to the subscribers using Extensible Markup Language (XML). Subscribers use the published information to update their queries when the event occurs.
Parameters
A parameter for a query is a placeholder for a value that is evaluated just before a query is executed. A subscriber must be using a query that contains at least one parameter in order to participate in an event. Subscribers listen for the key name/value pairs published by other result viewers. If an event occurs and the names of the parameters contained in a subscriber’s query match the names of the published keys, the subscriber will respond to the event by using the published key values as parameter values for the query it displays.
You can create a query that contains parameters with the Create a Query wizard. For more information on how to create a query that contains parameters, refer to Parameters.
EventAlias and EventNameSpace
Every query is built on one or more data permissions. Each data permission is automatically given an alias. An alias is a name that is used to help identify the data permission. In a query definition, the alias is used, rather than the actual name, to allow the data permission to be used more than once.
Each data permission has one or more keys associated with it. Any property of an entity that is named ID or stereotyped as <<id>> will be a key for a data permission based on the entity. For example, a data permission based on the Lead entity, included in the BPSDK sample application, will have just one key that corresponds to the LeadID property, since this property has been stereotyped as <<id>>.
The name used for the key value is the same name as the corresponding property in the UML model. It’s not the display name for the property that appears in the Business Portal. |
When an event occurs, the keys for one data permission used by the query will be published. Every publisher has an EventAlias property. This property determines which keys will be published when an event occurs. A result viewer will publish the keys for the data permission whose alias is assigned to the result viewer’s EventAlias property.
A subscribing result viewer’s EventNameSpace property identifies the types of values the subscriber is expecting to receive when an event occurs. It must be set to the fully-qualified name of the entity whose property values are the ones the subscriber expects to receive when the event occurs. For example, if a subscriber is expecting to receive a value for the Lead entity’s LeadID property, the subscriber’s EventNameSpace property must be set to the fully-qualified name of the Lead entity which is BPSDK.Sample.Lead.
Some result viewers, such as the Rich List and the Simple List, are capable of both publishing and subscribing to events. In this case, you’ll need to specify a value for both the EventAlias and the EventNameSpace properties. |