The Commitment Editor allows you to view, edit, and create commitments. Commitments are based on a particular action; they specify the time an action will be committed and the agent to which the action will be committed. The Commitment Editor is shown in Figure 46.
Figure 46. Commitment Editor
The File menu allows you to create a new commitment, save the current list of commitments, close the Commitment Editor, and exit the system. The Edit menu allows you to delete commitments from the defined commitments list. The Windows menu lets you switch between AgentBuilder tools that are open. The Help menu gives you access to the AgentBuilder Help system.
The Commitment Properties panel allows you to create a new commitment or view a defined commitment. The Commitment Properties panel allows you to specify a commitment's action, description, parameter values for the action, agent to commit the action to, and the time the action should be executed.
The Defined Commitments panel allows you to add new commitments to the list or delete defined commitments from the list.
Before creating a new commitment, the Commitment Properties panel must be cleared. If a commitment is currently being edited, then you can select New from the File menu. Selecting the New menu item will cause the system to ask you to confirm that you wish to start editing a new commitment.
To create a commitment, you must enter the required information into the Commitment Properties panel. You must select an action for which this commitment is defined. The Commitment Properties panel contains two radio buttons for selecting User Defined Actions or Built-In Actions . The Actions combo box displays the appropriate actions depending on which radio button is selected. Currently, actions that are tied to commitments must be connected to a PAC instance. Once an action has been selected two things will happen. The selected action's method will be queried and, if the action's method contains any parameters, the Specify Parameter Values button will be enabled; if the selected action's method does not contain any parameters, the Specify Parameter Values button will be disabled. If the Specify Parameter Values button is enabled, then you must specify all parameter values. This process is explained in the following section. After selecting an action, the text field in the Defined Commitment's panel will show the name of the selected action.
After an action has been selected, you must specify the agent to whom the commitment will be made. The Committed To combo-box is located below the Specify Parameter Values button. This combo-box is an editable combo-box, and contains a list of available agents. The list of agents is constructed using the agencies to which the current agent belongs. To specify an agent, you can either select from the list of agents provided or manually enter an agent's name in the combo-box. If you manually enter an agent's name, you must press the Enter key in the combo-box so that the agent's name can be entered. Once an agent has been specified, the agent's name will be displayed in the Defined Commitments text field.
You must also specify a time to execute the action. The combo-box at the bottom of the Commitment Properties panel is the Time pull-down menu. The Time pull-down menu provides a number of options including StartupTime , ShutdownTime and a user-defined time. If you select the user-defined item, the system will display the Time Dialog described below. If a user-defined time is entered, the time will be shown in the combo-box. Once a time is specified for the commitment, this time will be shown in the Defined Commitments text field.
You can also enter a description for the commitment in the Description text area.
The Parameters Dialog allows you to easily specify parameter values for simple and complex objects. The dialog consists of two sections: a Parameter Tree panel and a panel that can switch between a Parameter panel and a Complex Parameter panel. The Parameters Dialog is shown in Figure 47.
Figure 47. Parameters Dialog
The Parameter Tree panel contains a hierarchical tree of the parameters. The tree nodes use the following convention for labeling name(type). The root node is labeled with the action name and the action's PAC type. The children of the root node are the parameters for the action's method. Any child nodes with a folder icon indicate that the parameter is a complex object whose constructor must be specified.
The color of the nodes is also significant. Nodes whose values have not been specified have a red label; nodes whose values have been specified have a black label. An unspecified node recursively sets its parent to be unspecified so that you can easily see which nodes have not been specified when the tree is fully collapsed.
To specify a parameter value, you must first select the parameter to be specified. Based on the type of node selected, the panel below the Parameter Tree will display either a Parameter panel or a Complex Parameter panel. Both the Parameter panel and the Complex Parameter panel contain a read-only Name and Type text field. The name and type of the selected node is shown in the read-only text fields. The primary difference between the two panels is that the Parameter panel allows you to specify a value for the selected parameter. To enter a value for the selected parameter, enter a value into the Value text field in the Parameter panel. To enter a null value for the parameter, you must type null into the value field. An empty string is considered to be a valid value and can also be entered into the value field. Once a value has been entered, you must press the Enter key on your keyboard while the cursor is positioned in the Value text field or click on the Enter button in order to enter the value in the selected parameter. The new value will be shown in the tree after it has been entered.
The Complex Parameter panel contains a pull-down menu for specifying a constructor for the selected parameter. This is necessary because the selected parameter's type is a complex object. You must now select a constructor from the Constructor pull-down menu.
If no constructors are listed, you must create a constructor for the complex object. To do this, go back to the Object Modeler and open the ontology that contains the complex object. You can then modify the object's properties to include one or more constructors. The object model must then be saved, and the PAC Editor must be opened from the Agent Manager. From the PAC Editor, update the object model that contains the updated PAC. (Please refer to PAC Editor for information on updating PACs.)
Once a constructor is selected for the complex object, the tree node for the complex object will change based on the selected constructor. Any parameters that are in the selected constructor become children of the tree node. If the children's types are all Java types, then you can assign values to the parameters as described above. Otherwise, if the children's parameter types contain complex objects, the process of selecting a constructor and specifying values must be repeated. This process must be repeated until all leaves either contain Java types or the selected constructors for complex objects have no parameters.
Once you have fully specified the parameter tree, you can click on the OK button to register the new parameter values. Clicking on the Cancel button will cancel any changes that were made to the parameter tree.
The Time Dialog allows you to specify a specific date and time that an action will be committed. The date is specified by selecting a month and day from the pull-down menu. The year must be entered (typed) in a four digit, numerical format. The time is specified using the format hh:mm:ss . Time uses three text fields with only numerical entries allowed. This dialog is shown in Figure 48.
Figure 48. Time Dialog
Once you have specified a date and time, you must select the OK button in order for the time to be set for the commitment. Any invalid entries will cause an error dialog to be displayed. You will be given an opportunity to correct any errors. If you wish to cancel operations using the Time Dialog then select the Cancel button. Selecting the Cancel button will ensure that the Time pull-down menu remains unmodified.
Once a commitment has been completely defined, the Defined Commitments panel Add button is enabled. In order to construct a completely defined commitment, you must specify a selected action, any parameter values specified through the Parameters Dialog , a selected agent to commit to, and a time to perform the action.
Pressing the Add button will add the commitment in the Defined Commitments text field in the list of defined commitments. Notice that the Commitment Properties panel is reset, readying it for defining a new commitment or viewing defined commitments
You can view commitments that are in the Defined Commitments list. Selecting a commitment will cause the selected commitment to be displayed in the Commitment Properties panel.
Once you load a defined commitment into the Commitment Properties panel, you can edit the commitment using any of the steps outlined in Creating a Commitment. If you want to add the edited commitment to the list, then add the commitment as outlined in Adding a Commitment. If the edited commitment has the same action and agent, the edited commitment will overwrite the old commitment. Otherwise, it will be added to the list of defined commitments.
If you want to delete a defined commitment, you have two options. You can first select the commitment in the Defined Commitments list and then click on the Delete button to the right of the list. You can also select the commitment in the list, then select the Delete menu item in the Edit menu.
Once you have completed adding and deleting commitments, you must save the commitment list for the current agent. To do this, select the Save menu item from the File menu.
The Windows menu is a dynamic menu that displays a list of all AgentBuilder tools that are open. This menu facilitates switching between the tools when multiple tools are open. To switch to the desired tool, select the tool from the Windows menu. The selected tool will then be brought to the front on your display.
The help system can be accessed using the Help menu item. The About menu item allows you to read the help information for the current tool. The Index menu item will display an index to the help system's contents. The Tutorial menu item will display the Quick Tour of the AgentBuilder toolkit. The About AgentBuilder menu item will display the AgentBuilder logo along with the version number and copyright information. The AgentBuilder Home Page menu item will display the home page for the AgentBuilder product.