Creating a Reaction: Inserted Event  

This task explains how to use the Inserted event in a reaction feature. In the scenario below, you are going to insert an element into the CATProduct document, which displays a message.
  1. Create a CATProduct file called Container.CATProduct and insert the KwrSyringeContainer.CATPart file by using the Insert > Existing Component... command. Save your file and close it.

  2. 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. Close the file.

  3. From the Start > Knowledgeware menu, access the Knowledge Advisor workbench and click the Reaction icon () to create a reaction. The reaction dialog box opens. 

    • In the Source type field, select Selection for the Reaction to be applied to the element you select (plunger in this example).

    • From the Available events list, select Inserted if you want the action to be launched when the Plunger is inserted into the CATProduct.

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

    • Click OK. A reaction is added to the Relations node in the specification tree.

    • Save the file and close it.

  4. Save the file and close it. 

  5. Open the Container.CATProduct file, select Insert > Existing Component.... The File Selection dialog box opens.  Select the Plunger.CATProduct file and click Open. The message specified step 3 is displayed.

     
For more information about the Reaction feature window, see Using the Reaction Feature Window.