IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Services and service-related functions > Access external services with adapters > Configure and using adapters > IBM WebSphere Adapters > IBM i > Configure the module for deployment > Configure the module for outbound processing > Calling IBM i programs

Selecting business objects and services

Use the list of objects discovered by the external service wizard to select the IBM i server business objects that you need to access in your module. Then provide configuration information for your new business objects.

Ensure that you have set the connection properties for the external service wizard.

The adapter reads the configured pre commands from the business object and runs the pre commands on the IBM i system. To call a program, use the following procedure. The Find Objects in the Enterprise System window allows you to select and call programs. For more information about any of the properties in this topic, see the manage connection factory properties reference topic in this guide.

Procedure

  1. Ensure that you have selected one of the options given below from the Object type to discover list while you are selecting an object type while setting the connection properties and click Next .

    • RPG via PCML
    • COBOL via PCML
    • SRVPGM via PCML
    • RPG Program
    • COBOL Program

  2. In the Find Objects in the Enterprise System window, click Edit Query to modify the existing query as per your requirements. Type a pattern to filter the PCML type selected by you previously. The default value is *, where all programs matching the filter are displayed in the Discovered objects pane. The * and ? are valid wildcard characters, with * representing more than one character and ? representing a single character. Invalid PCMLs are marked with an invalid icon indicating they cannot be selected and added to list of selected objects.

    Figure 1. Find Objects in the Enterprise System window

    For the number of programs in the PCML, only those many numbers of business objects are created. Invalid PCMLs are those PCML for which the path is null or the Call IBM i program object types such as RPG or RPG via PCML, COBOL, or COBOL via PCML or service program (SRVPGM) does not exist.

  3. Select the PCML as per your requirement and then click the > (Add) button to move it to the selected set.

  4. In the Specify the Configuration Properties for 'object' window for the selected program, configure the pre and post commands to be executed before the program execution on IBM i system. Pre commands are to be executed before the program execution on IBM i. Post commands are to be executed after the program execution on IBM i. You can add any number of pre commands and post commands. Stop On Error indicates whether the execution must stop or continue in case of any error during the command execution. If Stop On Error for a command is set to true and error occurs during execution of the command, then an ErrorCompletingRequestFault is generated and execution stops. If Stop On Error for a particular command is set to false and if an error occurs during command execution, then the command execution continues to execute the next commands and program, irrespective of the error.

    • RPG via PCML or COBOL via PCML: The following figure displays a typical Specify the Configuration Properties for 'object' window for a RPG via PCML or COBOL via PCML program.

      Figure 2. Configuration properties for ADD2NUM.PCML window

    • RPG Program or COBOL Program:

      The following figure displays a typical Specify the Configuration Properties for 'object' window for a RPG Program or COBOL Program.

      Figure 3. Specify the Configuration Properties for RPGCALL3.MBR window

      You will not get any exception message when there is a pre compilation command failure. See the log files for troubleshooting.

    • SRVPGM via PCML: The following figure displays a typical Specify the Configuration Properties for 'object' window for a SRVPGM via PCML program.

      Figure 4. Specify the Configuration Properties for ADD2NUMSRV.PCML window

    To configure a pre command or post command:

    1. Click Add to add commands to be executed before or after the program execution on IBM i. The following figure shows the Add/Edit window to add a new command.

      Figure 5. Add Edit Properties window

    2. In the Command field, enter the command name.

    3. Select the Stop On Error check box to stop the execution of the command if there are errors during the execution.

    4. Click Finish to add the specified properties. A new row is appended to the table, as shown in the following figure.

      Figure 6. Configuration Properties for program window

    5. For RPG Program or COBOL Program, you can specify the commands for the compilation environment in the Commands for compilation environment area. These commands run even before the adapter compiles the RPG or COBOL programs as PCMLs. In the Enter the path where the PCML will be generated, specify the path to store the generated PCML files in the IBM i system. You have an option to change the default folder path.

    6. For SRVPGM via PCML service program, you can specify the Pass By Type. You can choose between Pass By Value and Pass By Reference.

    7. Click OK to return to the Find Objects in the Enterprise System window.

  5. Click Next. The Specify Composite Properties window is displayed.


What to do next

From the Specify Composite Properties window, add, or remove the associated operations.

Calling IBM i programs