Using the CallAPI

You can use the CallAPI to trigger processes in the AE system from externally by using the Automation Engine scripting language. This topic describes how you use the CallAPI either with your own program or in with a utility. The Automation Engine scripting language is limited to 32000 characters in any case.

Use your own program

To call the CallAPI from your own program, this program must be written in one of the following programming languages:

Examples are supplied for all supported platforms.

Use a utility

You can use a utility which is provided for each supported platform. No programming knowledge is required in this case. You can call this utility from jobs, procedures, executable files or directly from the command line, depending on the operating system you are using.

Write the script 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 fileSCRIPT=script file [LOGON=client,user,[department[,password]]] [INI=INI file]

Parameter

Description

SCRIPT=

Path and name of the script file

Optional:

No login data is necessary when it is already specified in the INI file.

LOGON=

Login data

INI=

Path and name of the INI file

You must specify this parameter when the INI file has been renamed or moved to different

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 during logon/execution.
Note: Return code 12 can refer to any fatal error that occurred during logon or the execution of the CallAPI script. You need to solve these causes manually.

16

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

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

Scripts that are started via a CallAPI are displayed in the Process Monitoring perspective and a statistical record is created that includes a report. Use the Including or Excluding Deactivated Tasks checkbox to search for it specifying type API or its RunID.

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 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 that is returned when you run the utility is the CallAPI script's RunID.

See also:

Setting Up the CallAPI
:PUT_READ_BUFFER to supply the script variables of an activated object with values