Debug

From PresenceWiki
Revision as of 12:51, 14 July 2010 by Admin (Talk | contribs)

Jump to: navigation, search

Before putting a Task on the Live Tasks Queue or enabling it to be called On Demand, it is typically a good idea to test it out and make sure it's doing what you expect it to.

This is where the Presence Debug Tool comes in handy. The Debug Tool allows you to step through the individual Task Elements one by one, examine the information that is passed between them, and view any logging information.

Launching the Debug Tool

To launch the Debug Tool, you first need to have the Task open and the appropriate tab selected. There are three ways to begin debugging the Task:

- Click on the Debug Icon http://www.international-presence.com/wikidocs/images/debug_1.gif

- Right click on the Task Design View (not on a Task Element) and select Debug from the pop-up menu

- Click on the "Task" menu at the top of the Administration Client, and select "Debug Current Task".

There is also a "Debug on..." option for the second and third methods. This allows you to select a server to debug the Task on if you have a multi-server environment.

Using the Debug Tool

Here is a screen-shot of the Debug Tool:

http://www.international-presence.com/wikidocs/images/debug_2.gif

There are four main components to this window.

  1. Stepping Controls These are at the top of the left hand panel. The controls consist of a Pause, Step, Play, and Fast Play button.
  2. Context Inspector This is below the Stepping Controls and lets you inspect the current Presence Context
  3. Task Log Viewer This allows you to view any log output generated by the Task in real time.
  4. Task View This is a smaller version of the Task, and the Task Element that is about to run will be highlighted.

Stepping Controls

  • Pause: This pauses the currently running Task if you have clicked on "Play" or "Fast Play".
  • Step: This executes the currently active Task Element, highlights the next in the sequence, and waits for the user to press Step again.
  • Play This executes the entire Task, highlighting the currently executing Task Element as it proceeds through the sequence.
  • Fast Play This runs the remainder of the Task without any visual feedback as to where in the Task it is currently running.

Context Inspector

This allows you to inspect items in the Presence Context by clicking on the item and viewing the value in the pane to the right. The Data Table is presented as a tree, with each column name as a branch and each row as a leaf within the branch.

Variables are displayed under the Data Table and are split into Local and Task Variables. Global Variables are not displayed here.

Internal Variables

These are Variables generated by Presence.

  • ${presence.servername} - The host name of the server that the Task is running on.
  • ${datatable.columncount} - The number of columns in the current Data Table
  • ${datatable.rowcount} - The number of rows in the current Data Table

Task Log Viewer

This displays the most recent log entries for the Task and should automatically update as the Task progresses. The buttons above the log pane perform the following functions:

  • Edit - edits the current Task Element
  • Delete - removes the selected log entries from the log file
  • Refresh - refreshes the logs from the log file.

Task View

This is a scaled down overview of the Task. The current Task Element is highlighted with a blue border. As you step into Nested Tasks the view will be updated with the schematic of the Nested Task.

Breakpoints

Presence allows you to add Breakpoints to your Tasks. To do so, in the Task Design View, right click on a Task Element and select "Add Breakpoint" from the pop-up menu.

If you then click on the "Play" or "Fast Play" button, the Task will continue to run until it hits a Breakpoint, at which point it will stop and wait for user interaction.

This feature is especially useful if you want to debug a specific part of Task but do not want to have to step through all the preceding Task Elements.