Access Keys:
Skip to content (Access Key - 0)

Commands Log and History

Presentation

To activate this view, click on the third tab on the console panel:

  • The left pane displays all registered commands, with the number of times they have been runned
  • The center pane displays the history of a given command, with its command number for this type of command, and the line where it started from
  • The right pane is for inspecting the parameters of each individual command (coming from initial CairngormEvent that is associated with the command)
  • The left pane displays the stack trace for the selected command

To get more information about this view, please go to Reference guide

How to use the Commands view

We will continue to discover the demo application in order to learn how to use the console.
Please, restart the demo application, and once the console opened, switch to the "Commands" tab.

List of commands

What we discover in the left pane is the list of all registered commands, (ie registered at the FrontController level through Cairngorm registerCommand method). The second column of the datagrid displays the number of times each command has been executed.

Select the line containing for "LoadEmployeesCommand": the center list now displays the history of that command, with the starting line for each of these entries. There is only one item as this command has been executed only once until now.

Thus, after startup, we discover that:

  • The application has registered 8 different commands
  • LoadEmployeesCommand is the only command that has been runned
  • LoadEmployeeCommand has been started from CafeTownsend.mxml, method loadEmployee(), line 46:
    private function loadEmployees() : void {			
      var cgEvent : LoadEmployeesEvent = new LoadEmployeesEvent();
      CairngormEventDispatcher.getInstance().dispatchEvent(cgEvent);
    }
    

Commands in action

The main command list is live and is refreshed in real time, according to what happens in your application:

  • When a new command is registered in the system, a new line will appear in this list
  • If a command is unregistered (which is unlikely to happen), it is also removed from the list
  • When a command is executed:
    • The corresponding line is moved to the top of the list, so that the first displayed commands are always the last that have been runned.
    • The corresponding line will glow, so that you have a visual clue of what command has been fired
    • The command counter will be incremented by one unit

To try it and watch how it works, keep the console opened, and log in into the application now, while observing the console.
You should see that the LoginEmployeeCommand item briefly glows, is moved to the top of the list, and has now a counter value of 1.
Now, select "LoginEmployeeCommand" to display its history, and select the single history item displayed.
In the right pane, we are now able to inspect the parameters of the command, which is actually the CairngormEvent was been fired to trigger command execution.
Interesting values here are password and username properties, that contain the values entered on the login screen

You may now play with the application for a while, and observe what commands are dispatched, from where they come from and what are their parameters.

Next >> Cairngorm Events

Related Projects

Top News

Latest Updates: 2012/01/17

Release on:

Need Information?

Why Kap Lab?

Kap Lab exists because in innovation we trust. Enjoy our products and help us to give you the best.

Cyril Daloz
CEO Kap IT

Adaptavist Theme Builder (3.3.5-conf210) Powered by Atlassian Confluence 2.10.3, the Enterprise Wiki.