Using the Knowledge Language Behavior

This scenario provides you with an example showing how to use the Knowledge Language behavior to compute the volume of a cap, and to transfer this value to one of the technological type variables. This scenario is broken down into the following steps:

Create a Technological Object

  1. From the Start>Knowledgeware menu, access the Business Process Knowledge Template workbench.

  2. Create the Volume technological type. To do so, click the Create Technological Type icon () to create a type. The Create technological type dialog box is displayed.

  3. Enter the name of the type: Volume and click OK to validate.

Add a Variable (Attribute)

  1. Add an attribute to the technological type. 

    • Click the Volume type in the specification tree and click the Add Attribute icon ( ). The Add Attribute dialog box is displayed.

    • In the Name field, enter the name of the attribute: ComputedVolume.

    • From the Quality scrolling list, select Output.
    • From the Type scrolling list, select Volume. Click OK to validate.

Add Behaviors to the Technological Type

  1. Click the Volume type and click the Sequence Combination Behavior icon (). Double-click SequentialCombination in the Behaviors View and double-click Volume in the Behaviors tab.

  2. Double-click the SequentialCombination node. The Sequential Combination editor is displayed. In the Name field, enter Computing_a_volume, and click OK to validate.

  3. Click the Computing_a_volume node and click the Bind Object behavior icon (). 

  4. Double-click the BindOjbect node in the Behaviors tab. The Bind Object editor is displayed. 

  5. In the Relative Name field, enter PartBody to specify that you want to compute the volume of the PartBody and click OK to validate.

  6. Click the Computing_a_volume behavior and click the Knowledge Language behavior icon () to create the script that will compute the PartBody volume. 

  7. Double-click the KWALanguage behavior in the Behaviors tab. The KWA Language editor is displayed. 

  8. Click Edit. The script editor opens.

  9. Enter the following script and click OK to validate:

    let Element(Solid)
    set Element=Volume\Computing_a_volume\BindObject\Link
    Volume\ComputedVolume = smartVolume(Element)
  10. Save your file in the <CATGraphicPath> directory.

Generate the Workbench

  1. Click the Generate Applicative Workbench icon () to generate a user workbench. The Applicative Workbench Generation dialog box is displayed.

  2. Click Manage categories. The Deployed Workbenches and User Categories Management window is displayed.

  3. Enter the name of the new category (MyCategory in this example) and click Create category. Click OK when done.

    For more information about the Generate Applicative Workbench command, see Deploying a User Workbench.
  4. From the current user category scrolling list, select MyCategory.

  5. In the Workbench name field, enter the name of the workbench (MyWorkbench in this example).

  6. From the Workbench type scrolling list, select Part and click OK when done. Click OK in the File Name dialog box. Your user workbench is created.

Test the Workbench

  1. Open the BktCap.CATPart file.

  2. Click the root of the specification tree, the icon, the root of the specification tree, and click the Volume icon to type the Part.

  3. Right-click Volume (Cap1) and select Volume Cap1 object>Computing_a_Volume

  4. Expand the Volume Variables node and double-click the ComputedVolume attribute. The Attribute Modification dialog box is displayed indicating the Cap volume.

For more information about the Knowledge Language behavior, see KWA Language Behavior: Data Sheet.