Main Agenda

When you open a Knowledge Module in the Knowledge Explorer window, the Main Agenda tab page allows you to define the main control agenda for the application. This provides a sequential 'master script' of how you want the application to work.

The mechanics of editing the main agenda are the same as for Editing Scripts.

It is also often used to control the overall looping of an application and the generation of final reporting, summaries or calculations. To make the agenda easier to follow it is recommended that @Do commands are used to call other procedures as sub routines, rather than include long command sequences within the body of the main agenda itself.

When you create a new Knowledge Module, this default main agenda will be created.

@DEBUG 'Remember to set startObject & define reports'

@DO startObject

@DEBUG 'The outcome is ' + startObject

@REM Replace above startObject with actual name

The first @Debug statement is put there as a default error trap to remind you to edit the main agenda if you try to run your application. You would also get a command error caused by the @DO command, saying that there is no object called "startObject" if you do not edit this default main agenda.

In its simplest form the main agenda only needs two commands. The first to invoke the root object of the application which would start the inference process and the second to report on the outcome of inference.

For example:

@DO Expenses

@DEBUG 'The outcome of the application is ' + Expenses

Where the List type Attribute Expenses has a decision tree, this agenda could be used to invoke inference from the decision tree of Expenses and then display the value of the leaf outcome of the tree.

Once the inference process is started, the start objects themselves can invoke other objects.

For example, when you start inference from an attribute with a decision tree it would automatically invoke any more decision trees that are backward chained from it. This is, where one decision tree may contain attributes that themselves also have knowledge in the form of decision trees.

The help topic on the @Do expands in more detail over what happens when you call different types of objects, and describes some common problems that you can avoid.