Creating a Knowledge Advisor
Reaction: Inserted Event
![](../icons_C2/common/atarget.gif) |
This task explains how to use the Inserted
event in a reaction
feature. In the scenario below, the user inserts an element into the
CATProduct document, which displays a message. |
![](../icons_C2/common/awarning.gif) |
The Reaction capabilities require the Knowledge Advisor product. |
![](../icons_C2/common/ascenari.gif) |
- Create a CATProduct file called Container.CATProduct and insert
the KwrSyringeContainer.CATPart
file by using the Insert->Existing Component...
command. Save your file.
- Create a CATProduct file called Plunger.CATProduct, rename the
root of the specification tree to Plunger, and insert the KwrSyringePiston.CATPart
file by using the Insert->Existing Component...
command.
- From the Start->Knowledgeware menu, access the Knowledge Advisor workbench and click the Reaction icon
(
)
to create a reaction. The reaction dialog box opens.
![](images/kwrReactionInsertedEvent1NLS.gif) |
![](_themes/v5r5/ul1.gif) | In the Source type field, select Selection
for the Reaction to be applied to the element you select
(plunger in this example). |
|
![](_themes/v5r5/ul1.gif) | In the Available events list, select Inserted
if you want the action to be launched when the Plunger
is inserted into
the CATProduct. |
|
![](_themes/v5r5/ul1.gif) | In the Action field, select Knowledgeware
action and enter the following message: Message("Plunger
inserted"). This message will be
displayed after the plunger is inserted. |
|
![](_themes/v5r5/ul1.gif) | Click OK. A reaction is added to the Relations node in
the specification tree. |
|
![](_themes/v5r5/ul1.gif) | Save the file and close it. |
|
- In the Container.CATProduct file, select the Insert->Existing
Component... command. The File Selection dialog box opens. Select the
Plunger.CATProduct
file and click Open.
- The message specified step 3 displays.
![](images/kwrReactionInsertedEvent2NLS.gif)
|
![](../icons_C2/common/ainfo.gif) |
To know more about the Reaction feature
window, see Using
the Reaction Feature Window. |
|