Launching the Knowledge Debugger

You can launch the knowledgeware debugger by selecting the object you want to debug in the tree or by using the Knowledge Monitor or the context menu on actions.

This task shows you how to:


Before you begin: You must have created and saved an action in Engineering Rules Capture containing a script. In this topic, we are using the following script:
let m(Integer)
m=10
PopupMessage("from inside my action, line 1")
PopupMessage("from inside my action, line 2")
PopupMessage("from inside my action: #",m)

Debug an Action

You can start a code directly in debug mode when you work with an action. Launching a code in debug mode is the simplest way to launch a given script, break on its first line, and interact with the knowledge debugger.

  1. Open the product containing the action.
  2. Right-click the action and select Action.object > Debug.
    The knowledge debugger appears.
  3. Click OK in the Insert Object dialog box.
    The knowledge debugger displays the action code, breaks on the first line, the Stack and Debugable fields show the action.
  4. Click Step over.
    The first message is displayed and the parameters view shows the value of m=10.
  5. Double-click 10 and enter another value, 15 for example.
  6. Click Step over.
    The second message is displayed.
  7. Close the knowledge debugger.
    The third message is displayed and the value is still 15.

Add an Object to Debug In the Tree

Another way to open the knowledge debugger is to click the Add to Debug Context command and selecting the object you want to debug in the tree. This method is the one you should use when the object you want to debug does not appear in the tree.

  1. From the Tools section, click Knowledge Monitor Debug .
  2. In the Knowledge Monitor Configure dialog box, click Add to Debug Context.
  3. Click the object you want to debug in the tree.
    The knowledge debugger is launched showing the script to debug.
  4. Add breakpoints to your code and run it using the debugger commands as shown in the scenario above.

Add an Object to Debug From the Knowledge Monitor

You can attach the knowledge debugger to a 3DEXPERIENCE session from the Knowledge Monitor. The code you want to debug must have been run at least once before launching the knowledge debugger. This method lets you add scripts to the list of debuggable objects and add breakpoints to your scripts. For example, it can be useful if the action is launched by a rule pointing this action using the action->Run() expression.

  1. From the Tools section, click Knowledge Monitor Debug
  2. Select your options and click OK.
  3. Run the script you want to debug.
  4. Click Open Knowledge Monitor.
  5. In the Knowledge Monitor window, right-click the object you want to debug in the left tree and select Add to Debuggable Objects.
    The objects are added to the knowledge debugger.
  6. Add breakpoints to your code and run it using the debugger commands as shown in the scenario above.