The RULES_SIMULATION_EDITOR Widget

The RULES_SIMULATION_EDITOR widget is used to edit or create data used when simulating the execution of a rule-set. The widget generates clusters of fields that correspond to the fields of Rules Data Objects (RDO). A normal cluster is used to display the fields of a basic RDO and a multi-column cluster is used for a list RDO. A standard list is not used, as a list RDO with many fields would result in a list that had too many columns to be displayed on the screen.

The user can enter or modify values on the page corresponding to the RDO fields and, for list RDO s displayed in a multi-column cluster, press a button to create additional columns for field values.

The WIDGET element should have the TYPE attribute set to RULES_SIMULATION_EDITOR. The parameters to the widget are as follows:

Table 1. Parameters to the RULES_SIMULATION_EDITOR Widget

Parameter Name

Required

Description and Connections

VALUES

Yes

The simulation data values. A previous set of values can be displayed and edited or a new set of values can be created.

The parameter should contain a CONNECT element with a SOURCE set to a DISPLAY phase bean field containing the values and a TARGET set to an ACTION phase bean field that will receive the edited values. If the SOURCE has no values set, the editor will create them.

META_DATA

Yes

The simulation meta-data. The meta-data contains details about the structure of the RDO s necessary to generated the input fields.

The parameter should contain a CONNECT element with a SOURCE set to a DISPLAY phase bean field containing the meta-data.

ADD_BUTTON_CAPTION

Yes

The caption to use on the button displayed at the bottom of each multi-column cluster and used to add a new column of extra data to a list RDO. If an image is also specified, this caption is used as the "alt" text of the image.

The parameter should contain a CONNECT element with a SOURCE that gets a localized string from a TEXT source.

ADD_BUTTON_IMAGE

No

The path to the image file to use if an image button is to be used in place of a standard button. The path is relative to the WebContent folder.

The parameter should contain a CONNECT element with a SOURCE that gets a localized string from a TEXT source.

The widget should be placed in a CLUSTER element. The clusters for the RDO s will be rendered within that cluster. The SHOW_LABELS attribute should be set to false. The LABEL_WIDTH attribute of the CLUSTER element will be inherited by the clusters that are generated by the widget, so it can be used to control the layout. An ACTION_CONTROL element in the cluster or on the page should be added to save and process the simulation data created by the widget in the usual manner.

When a widget is not supplied with any simulation data values, it will display empty fields. For list RDO s, a single empty column of fields will be displayed; values can be entered and more columns added as needed. If values are supplied, they will be displayed. In a multi-column cluster, pressing the defined "add" button will add a single empty column to the right of any existing columns. All other empty columns will be removed at this time, so deleting the values in one or more columns has the effect of removing those columns from the multi-column cluster.