Command

Visual LANSA Framework

Command

Key Concepts

You can enable a command for the Framework, an application or a business object and then assign a command handler to it.  The command handlers perform the actual processing in the application.

So far we have seen that Filters produce Instance Lists of Business Objects for end-users to action.

For example, a list of all the employees who started work last year might be produced by an Employee business object filter. 

To "action" a business object instance the end-user normally executes a command against it.

For example, working with the list of Employees that started work last year an end-user might then choose to execute one of these commands against one or more of the employees displayed:

  • Print
  • Send Email
  • Display History
  • Apply a Salary Increase

An application designer can actually enable a command for the Framework, an application or a business object and then assign a command handler to it.

The command handlers perform the actual processing in the application (eg: Prints the employee details, Sends the email, Displays the History, etc).

Framework Commands

Global commands, such as Exit, Backup and Help, are available anywhere, anytime.

Application Commands

Application commands are used when you are working within a specific application and they apply to the application as a whole. Backup, Restore and Reports might be valid commands when working with the Human Resources application.

Business Object Commands

Business object (Customers, Products, Orders) commands are used when you are working within a business object and they typically apply to the business object as a complete group or collection.

If you are working with a business object named Employee then for example New  would be a valid command.

Business Object Instance Commands

Business Object Instance commands can only be used when you are working within specific instances of a business object.

If you were working with a business object named Employee then Details, Skills, Timesheets, Print and Delete may all be valid commands for a specific employee.

 

Commands can be visualized by the Framework in several different ways. In a menu on the menu bar or in a pop-up menu:

On the toolbar:

When a user has selected an object and then selects (i.e.: executes) a command then the associated Command Handler is invoked.