How to: |
The Execute Wizard and the Include component enable you to call another procedure from the current one.
The Execute component allows one procedure to execute or call another procedure. The redesigned Execute Wizard allows you to view and select available procedures and supply values for parameters in the called procedure and also test that called procedure. The called procedure behaves as a completely separate procedure, with its own context.
Execute Wizard allows you to select the procedure that you are supplying parameter values for. Once this procedure is specified, Execute Wizard displays these parameters and prompts you to provide values for them. You can provide values for all parameters in the procedure, or can choose to provide values for only some of the parameters. If you provide values for only some of the parameters, you must provide values for the other parameters using another method. (For example, values are passed from another part of the application.) After providing parameter values, you can test the called procedure.
The Execute Wizard is available throughout all development areas of the product: Projects, Data Servers, and Managed Reporting. When working in Managed Reporting, the tool allows developers to use Standard Reports available in the Domain or use procedures that reside on the WebFOCUS Reporting Server.
Execute Wizard uses the WFDESCRIBE auto-prompting feature to locate and pass parameters. To activate the WFDESCRIBE feature, change the default value in the IBIF_wfdescribe setting in the cgivars.wfs file.
The Include component allows one procedure to run another procedure as if the second one were embedded in the first. In this case, the procedure being included (called) has full access to variables defined in the calling procedure. Using this tool, you can create an object that includes another procedure within a host procedure. There is no limit to the number of procedures that can be included.
The Component Connector toolbox opens.
The Open dialog box opens.
Tip: The Include component inserts the -INCLUDE command into the procedure code. Right-click the Include object and choose Quick View from the shortcut menu to see the -INCLUDE command.
The Component Connector toolbox opens.
The Execute Procedure Wizard opens.
The Enter Procedure Parameters window contains a list of variables contained in the procedure you are executing, and fields in which to enter values for those variables. This screen will not appear if the procedure you are calling does not have parameters.
The Execute Procedure Wizard - Summary window opens. This window allows you to view the name of the procedure you are calling and view the variables-value pairs.
Tip: The Execute component inserts the EX command in the procedure code. Hover your cursor over the Execute object to see the EX command. If you wish to run the embedded procedure, right-click the Execute object and choose Run from the shortcut menu.
In the following example, you will create two procedures. One procedure, named SALESREP, will contain a sales report with variables. The second procedure, called SVALUES, will contain the values for the variables in SALESREP, and will execute SALESREP. The result will be a sales report with variable values filled in.
Create the SALESREP procedure:
Create the SVALUES procedure:
The Enter Procedure Parameters window opens.
The Summary window opens.
When the SVALUES procedure is run, the following report appears.
WebFOCUS |