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 > Overview of WebSphere Adapter for IBM i > Technical overview > Outbound processing > Supported operations for IBM i programs

CallPGM operation

The CallPGM operation invokes an RPG program or a COBOL program and a service program (SRVPGM) on an IBM i machine.

Programs on IBM i system are stand-alone programs that can take some input through program parameters and run commands within the program and return results, if any. CallPGM operation is used to call any program (PGM) or service program (SRVPGM) (currently supported program listed is RPG and COBOL). In some scenarios, the program can call other program or database script or application that are in a different library on the same IBM i system. The target library path needs to be added to the current library list for the smooth execution of the program.

Before CallPGM operation is invoked, the adapter reads the configured IBM i pre commands from the business object and it runs the pre IBM i commands on the IBM i system. The decision to continue further execution or not is based on Stop On Error values.

If command execution fails and Stop On Error is configured to be true, then adapter generates an ErrorCompletingRequestFault.

The CallPGM operation is invoked and the adapter does the following:

  1. Builds the parameter list for the program from the attribute values received in the request business object.
  2. Establishes a connection with an IBM i system.
  3. Searches the target application in the libraries listed in the current library list if there is a call referring to other application or to a database. The system-recognized identifier is *LIBL.

  4. Runs the program on an IBM i system.

    If CallPGM execution is successful then adapter reads the configured post IBM i commands from the business object and will run the post IBM i commands on the IBM i system. The decision to continue further execution or not is based on Stop On Error values.

    If command execution fails and Stop On Error is configured to be true, then adapter generates an ErrorCompletingRequestFault.

    Programs do not return values directly. Instead, they take in all the input arguments provided by the adapter, complete the required processing, and write the result value into variables that are capable of returning business objects determined by the application-specific information in the passDirection type of parameter. The passDirection type can be Input, Output, or InOut. If passDirection is classified as "in," the adapter is an input. If passDirection is classified as "out," the adapter is for output. If passDirection is classified as "inout," then the adapter serves as both input and output.

For more details regarding the business object attributes for program operation, refer to section Business object attributes for operations.

Supported operations for IBM i programs