CallAPI

CallAPIs are used to trigger processes in the AE from external systems by using the Automation Engine scripting language. You can start executable objects, set or can read contents of variable objects, or can get specific information about the status of tasks. As an administrator, you set up the CallAPI, specify login data, connect to the AE, and define your platform-specific parameters. You can use the CallAPI either with your own program, or with a utility. The Automation Engine scripting language is limited to 32000 characters in any case.

This page includes the following:

General Information

Log in to the AE system

To log in to the AE system, the CallAPI requires a valid user credentials. A user must have the privilege Logon via CallAPI and must have Execute rights.

You can specify your login data (client, user, department, and password) in the INI file of the CallAPI. Alternatively, you specify it when you call the CallAPI.

You can encrypt your password by using the program UCYBCRYP.EXE. The encrypted string must not exceed 64 characters. For details, see Encoding Passwords.

No password verification takes place when you use single logon for your CallAPI. To do so, store the relevant data in the system variable UC_USER_LOGON. For details, see UC_USER_LOGON - Single Logon.

Connect to the Automation Engine

To activate your script in the required AE system, the CallAPI requires connection information for relevant communication processes. Enter this connection information in the INI file (such as 2217=localhost). In CallAPI calls from your own programs, you can directly assign it.

Messages

If you use a Job object that calls the CallAPI utility, you can see the related messages in the job report.

You can use the :STOP script statement to assign message numbers and texts to the CallAPI. They are stored in script variables and can be read with your own programs. The names of these variables depend on the programming language you are using. Depending on the stop mode that you define in the script statement :STOP, the script either aborts or continues to run.

Use the CallAPI with your Own Program

You can use the CallAPI to process scripts in the AE system from your own programs that are written in C, C++, Cobol, Java, or Visual Basic. Sound knowledge of the programming language in which the program is written is required for this purpose.

Scripts are always activated with the following three steps:

  1. Log in to the AE system.
  2. Transfer the script to the AE system.
  3. Log off from the AE system.

You can log in to several AE systems at the same time and process various scripts.

CallAPI with C, C++

The delivery directory contains sample programs that provide a detailed description of how you call the CallAPI. The file uccall3.h provides information about structure and functions.

Functions

You can use the several functions in your programs. They supply return code 0 if the action was successful, or a message number if an error occurred. The data type of all return codes is long.

Variables

Information such as the system name or the RunID of the script is stored in the structure UCCALL_PARAMS. It contains the following variables:

CallAPI with Cobol

You call the CallAPI by using the command CALL UCCALL3. Return code 0 is supplied if the action was successful or a message number if an error occurred.

Variables

The supplied sample program explains the structure AE-RECORD. It contains the following variables:

CallAPI with Java

This requires the class UCCALL3 to be imported from the package com.uc4.uccall3.

The delivery directory contains sample programs that show you how to log on, activate scripts, connect to different systems, find connections error, and so on. The supplied CallAPI documentation provides up-to-date information about the Java class, methods and available functions.

CallAPI with Visual Basic

This function is found in the COM object AE.Call3 which must be registered.

Example

regsvr32 c:\AUTOMIC\callapi\windows\bin\ucxbwi3c.dll

The delivery directory contains a sample program that provides a detailed description of how you can activate a script.

Methods

In your program, you can use the following functions. They supply return code 0 if the action was successful, or a message number if an error has occurred.

Attributes

Information about script execution is automatically stored in the following script variables:

Examples are supplied as part of the delivery package for all supported platforms.

Use the CallAPI Utility (ucxbxxxc)

You can use a CallAPI utility which is provided for each supported platform. You do not need to have any programming knowledge. Depending on your operating system, you can call this utility from jobs, procedures, executable files or directly from the command line.

Write the script that you want to use in a text file and assign this file when you call the utility. The following syntax applies to all platforms:

CallAPI file SCRIPT=script file [LOGON=client,user,[department[,password]]] [INI=INI file] [QUEUE=Name of Queue object]

Parameters:

(Windows) Example

UCXBXXXC SCRIPT=C:\AUTOMIC\CallAPI\script.txt LOGON=98,SMITH,PASSWORD INI=C:\AUTOMIC\CallAPI\WINDOWS\ucxbxxxc.ini

Notes:

The CallAPI utility supplies several return codes that can be used to monitor script activation:

(SAP) The start parameter for the RFC Server is different. -I is the only parameter and it specifies the path to the INI file:

Tip: Use the Including or Excluding Deactivated Tasks checkbox to search for your script and specify the task type CallAPI, or enter the Task RunID of the CallAPI script.

Platforms for CallAPIs

See Platforms for CallAPIs

See also:

:PUT_READ_BUFFER, :PUT_PROMPT_BUFFER