IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing monitor models > Create monitor models > Defining the visual model > Defining actions
Sending notifications to custom widgets
When you create custom widgets, you can enable communication between the diagram and the widgets at run time. You can click an area in the diagram and have it send information to other custom widgets created that are on the same page in the Monitor dashboard space. The widget can change its display based on the area that is clicked in the diagram. You simply design your custom widget to accept specific events and your diagram to emit those events.
For example, you could have a diagram of a store in which boxes correspond to departments. When Department A is clicked, the diagram fires an event and the inventory widget receives it. The inventory widget then makes a web service query to retrieve the inventory for department A and displays the inventory information.
To update a shape set so that clicking the associated shapes at run time affects your custom widgets:
Procedure
- Place your mouse cursor on the diagram and find the shape set in the area of the diagram that you want to affect. The cursor changes to a hand when it is on the shape set. Click the diagram to highlight the corresponding shape set in the table at the bottom of the page.
- Right-click the shape set in the table and click Add Action > Send Notification When Clicked.
- To control when the area in the diagram can be clicked at run time (and will notify the custom widgets), add a condition in the Condition row. You can either type directly into the cell, or, for a large expression, click the button to open a resizable window. For help writing the expression, press Ctrl+Space.
Because you are creating expressions to be resolved at run time, you can only use the elements in the context that the diagram is attached to. If the diagram is attached to a monitoring context, you can use the metrics, keys, counters, and stopwatches in that context. If the diagram is attached to a KPI context, you can use the KPIs in that context.
- Specify the value of the event code for the notification. The event code can be anything that you choose, for example, 'DepartmentSelectedEvent,' but you must design your custom widget to look for events that match the code that you specify. You can use an expression or a literal value. To use a literal value, put single quotation marks around the value.
- For each piece of information that the custom widget expects in the notification, right-click Send Notification When Clicked and click Add Attribute. Specify the attribute name and the value of the attribute. For the value, you can write any expression referring to metrics or KPIs within the associated context. The values will be resolved when the expression is evaluated at run time.
For example, you might want your notification to include the department ID corresponding to the selected department.
What to do next
In the dashboard space, you must set up wired connections between the diagram widget and the custom widgets.
Related information:
Developing for Monitor dashboard spaces