Using the CallAPI

The CallAPIProgrammierschnittstelle, die entweder direkt oder aus einem anderen Programm aufgerufen werden kann, und ein Script im Automation Engine-System ausführt. is available on various platforms and can be used for many purposes. Read more about its usage and the most important settings below.

CallAPI installationnull and INI files are described in the Administration Guide.

There are two ways to use the CallAPI. AE ScriptEigener Objekttyp in der Automation Engine is limited to 32000 characters for both ways.

CallAPI and Individual Program

The first possible way you can use the CallAPI is to call it from your own programs. These programs can be written in the following programming languages:

Examples for this way of using the CallAPI are supplied for all supported platforms.

CallAPI and Utility

No programming knowledge is required in order to use the CallAPI in the second way. A utility is provided for each supported platform. The utility can be called from jobs, procedures, executable files or directly from the command line. Different methods are available for use, depending on the operating system.

Write the script in a text file and assign this file when calling the utility. The following syntax applies for all platforms:

CallAPI file SCRIPT=script file [LOGON=client, user, [department [, password]]] [INI=INI file]

Parameter

Description

SCRIPT=

Path and name of the script file

LoginAnmeldedaten für Zielsysteme. Auch ein eigener Objekttyp in der Automation Engine. data can be omitted if it has already been specified in the INI file.

Optional:

 

LOGON=

Login data

INI=

Path and name of the INI file

This parameter is required if the INI file has been renamed or moved to another directory.

Example of calling the CallAPI in Windows:

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

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

Return code

Description

0

AE Script was activated without error.

4

AE Script was activated, but then terminated with the script statement :STOP MSG, 50, "Any text."

8

Error when activating script or the AE Script was terminated with the script statement :STOP MSG, 51 - 59, "Any text." or :STOP, NOMSG

12

Error when logging on to the Automation EngineDiese Komponente steuert ein Automation Engine-System. Besteht aus verschiedenen Serverprozessen..

16

Fatal error: The script file could not be opened or read.

Note that the start parameters for the RFC Server for SAP are different. There is only one parameter, -I, that specifies the path to the INI file.

Note: Return code 8 is displayed if the activation of AE Script has been canceled because of an error and cannot be continued. This can happen if a script element is not spelled correctly, or if an incorrect number of function parameters is specified. There are also errors that cause an output in the Message Window of the UserInterfaceVeralteter Begriff. Ersetzt durch: Automic Web Interface and/or the report but do not cause the AE Script to abort. This can happen if the commands ACTIVATE_UC_OBJECT and IMPORT include errors. The utility always ends with the return code 0 in such a case.

The RunID"Kurzform für ""laufende Nummer"". Hierbei handelt es sich genauer um eine Zahl, welche die Durchführung einer Aufgabe eindeutig kennzeichnet. Die RunID kann zwischen 7 und 10 Stellen aufweisen. Sie wird von der Komponente Automation Engine vergeben." returned when running the utility is the CallAPI script's RunID.

Login

The CallAPI requires a valid user in order to log on to the AE system. Login data consisting of client, user name, department and user can either be defined in the INI file or directly assigned when the CallAPI is called. The latter is preferred if login data is stored in both locations.

 The user logging on to the AE system via CallAPI must have the privilege "Logon via CallAPI."

 The AE user must have the appropriate authorizations in order to execute scripts.

Your password can be encrypted with the program UCYBCRYP. Note that the encrypted string must not exceed 64 characters.

The CallAPI can be used without password verification. The advantage of this is that the password is not stored in programs or procedures. Thus, it is not necessary to change it every time a new password is assigned. It is also possible to store the data for automatic login in the variable UC_USER_LOGON.

The above description shows that CallAPI usage requires the same procedure as manual login. Therefore, it uses a free Dialog license for each connection. Use the key RESERVED_API_USERS in the variable UC_SYSTEMS_SETTINGS (available in system client 0000) to reserve a number of Dialog licenses for CallAPI logins. This way, CallAPI and manual user logins do not block each other.

Connection to the Automation Engine

The CallAPI requires connection information for relevant communication processes in order to activate the script in the required AE system. Enter this connection information in the INI file. In CallAPI calls from your own programs, these can be directly assigned.

Messages

The script statement :STOP assigns message numbers and texts to the CallAPI. These are stored in variables and can be read with your own programs. The names of these variables depend on the programming language. Further details are provided in the chapter "Using CallAPI with your own Programs."

Call the CallAPI's utility with a JobVerarbeitung auf einem Zielsystem. Auch ein eigener Objekttyp in der Automation Engine. object in order to view report messages.

Depending on the syntax used in the script function :STOP, the script either aborts or continues to run.

See also:

About the CallAPI
:STOP