Rule Builder > Ruleset Parameters > Working With Ruleset Parameters > Setting Ruleset Parameter Values

You can set values for parameters contained in a package using the Execution tab of the Options dialog box. The parameter values in_dir or inout_dir are mandatory; therefore, by default this panel automatically pops-up when a package containing parameters of this type is executed. This panel is also used to display error messages related to parameters.

For ruleset parameters whose direction is out_dir or local_dir, the initial value property can be set in the Property Sheet.

The following example uses the fishstore repository located in the <InstallDir>\doc\docreferences\userbuilder\data directory.

To create a parameter of this type proceed as follows:

  1. Right-click the Fishstore package and then click Add Parameter on the shortcut menu.
  2. Click the parameter, rename it to Message, and set its type to java.lang.String in the Property Sheet.
  3. Right-click the DisplayMessages subpackage, click Add TRL Rule on the shortcut menu, and rename the rule to MyTRLRule.
  4. Using the Rule Editor, add the following condition and action to the MyTRLRule rule:
  5.  WHEN
    
  6.  there is a ShoppingCart
    
  7.  THEN
    
  8.  execute ?context.out.println("Message : " + Message)
    
  9. Click the Fishstore package, and then click the images/execute_buttona.png button or click the package and then click Execute on the project menu.
  10. You can also right-click the package and click Execute on the shortcut menu.
  11. The Execution panel is displayed. Set the value "This parameter displays a message" for the Message parameter and click the OK button as shown in Figure 15.2. If you do not want the Execution panel to appear automatically, clear the "Display parameters before executing" check box.

  12. images/execution_panel.png
  13. Figure 15.2    Setting the Parameter Value
  14. When execution is complete, click Output on the View>Debugger Panels menu to open the Output panel. The line "Message : This parameter displays a message" is displayed as shown in Figure 15.3.

  15. images/output_panel.png
  16. Figure 15.3    Output Panel Showing the Message Parameter

See Also

Ruleset Parameters | Adding Ruleset Parameters to a Top-Level Package


Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. PREVIOUS   NEXT