Using the RUN and CALL action commands

The CALL and RUN action commands allow a business rule to execute external COBOL programs, known as process extensions, or applications.

CALL Command

The CALL command is used to execute a COBOL process extension, (previously referred to as a user hook). This can be useful if complex processing is required to validate and update the transaction details, and where external data must be accessed.

For example, the business rules attached to the sales order entry function may need to ensure there is adequate stock on hand to meet a sales order, and a separate COBOL program (VALIDATE) has been developed to do this.

Command Value 1 Operator Value 2 Result
CALL VALIDATE     The VALIDATE.GNT cobol program is executed.
Note:  The COBOL program must be held in the SunSystems default top level directory.

When the CALL command is executed, the current transaction being processed by the rule is passed to the COBOL program with other information in the LINKAGE SECTION. If the transaction details are updated by the COBOL program, the modified transaction details can be returned to the business rules.

These COBOL process extensions must be developed by trained COBOL programmers who have a good understanding of the SunSystems data structures and processes. If you require further information please contact SunSystems Technical Support.

Note:  SunSystems always maintains the integrity of its accounting data. Any data that is returned to a system function from a process extension is always fully revalidated. If a CALL to a COBOL program is made after the transaction details have been validated or posted, any changes the program makes to restricted data items on the transaction details are ignored.

RUN Command

The RUN command runs an external Windows or other application from within business rules. For example, after an error message is displayed the RUN command could be used to initiate MS Notepad to enable the user to make a note of the error message.

Runtime parameters can be entered for the application in the Value 2 field. For example, the business rule might run MS Excel and pass the name of the worksheet to be updated as the parameter.

Note:  The full path name should not be entered in the business rule. The path to the external application should be added to the environment variable 'Path'.