Application Integration Guide > CallAPI > CallAPI and your own program > C, C++

 C, C++

The CallAPIA programming interface that processes a script in the Automation Engine system. It can be called directly from within the program itself or from a different program. can be used to process scripts in the AE system from your own C and C++ programs.

For this, you need to integrate the files uccall3.h and ucxbwi3c.lib. Note that your program requires access to the library ucxbwi3c.dll.

The delivery directory contains sample programs that provide a detailed description of how a scriptA particular Automation Engine object type. activation can be implemented.

The file uccall3.h gives information about structure and functions.

General

Scripts are always activated with the following steps:

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

You can log on to several AE systems at the same time and process various scripts. In this case, a Dialog license is used for each connection.

Functions

In your programs, you can use the functions listed below. These supply return codeThe value that represents the result of tasks and script functions. 0 if the actionActions are predefined building blocks for recurring activities. They are commonly used for managing third party systems or in deployment scenarios. was successful or a message number if an error occurred.

Description

Data type of return code

Function

Logging on to the AE system

long

UCCALL3_Logon (structure, loginAn Automation Engine object type that stores account credentials used by agents on target systems. data, connection)

Data type of structure: UCCALL_PARAMS*
Data type of login data: char*
Data type of connection: char*

Format for login data:  
Client, userIn the Automation Engine, a user is an instance of a User object, and generally the user is a specific person who works with Automic products. The User object is assigned a user ID and then a set of access rights to various parts of the Automation Engine system and product suite. These access rights come in the form of Automation Engine authorizations and privileges, Decision user roles and EventBase rights and ARA web application object rights. You can manage all these centrally in the ECC user management functions. See also, Unified user management.
, [departmentDepartment name to which the Automation Engine user belongs., [passwordA secret combination of characters for a Automation Engine user.]]

Format for connection data for the communication processA communication process is part of the component Automation Engine. It is responsible for connecting the components.:
DNS name:port number

or
TCP/IP address:port number

Activating a script

long

UCCALL3_ActivateScript (structure, script)

Data type of structure: UCCALL_PARAMS*
Data type of script: char*

Logging off the AE system

long

UCCALL3_Logoff (structure)

Data type of structure: UCCALL_PARAMS*

Universal functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,…

long

UCCALL3 (structures)

UCCALL3 can be called instead of the functions described above. In this case, indicate the opcode in the structure in order to have the required operation processed.

Data type of structure: UCCALL_PARAMS*

Variables

Information such as the system nameName of the Automation Engine instance to which a user is connected. or the script's returned RunIDShort for "run number". It is a number that provides unique information about a task's execution. The RunID can include 7 to 10 digits. It is assigned by the Automation Engine component . is stored in the structure UCCALL_PARAMS. It contains the following variables:

Data type

Variable

Description

char [4]

cOpCode

Operation code

This variableIt stores or retrieves values dynamically at runtime. An individual Automation Engine object type. must be set if the universal function should be used.

Allowed values:
"OPC_LOGON" - logs on to the AE system
"OPC_LOGOFF " - logs off the AE system
"OPC_ACTIVATE_SCRIPT" - activates a script

char

cErrorCode

The error code in cErrorCode is automatically set and can contain one of the following values:

" " - no error occurred
"P" - invalid parameter(s)
"O" - invalid opcode
"Q" - login failed
"R" - memory allocation failed
"L" - memory releaseReleases combine a set of activities and a set of packages as well as other release artifacts under a timeline (a plan including milestones and phases), which can be planned, baselined and tracked. failed
"S" - socket error
"T" - timeout
"U" - error message of the AE system

char [3]

cInterface

The interface number must always contain the value 3.

char [8]

cSystemName

Name of the AE system to which the connection should be established

unsigned short

sTimeout

Period in seconds during which the CallAPI waits for an AE system response

char

cLanguage

Language in which messages are output

unsigned char

cFlag1

Depending on the specified value, this flag results in one of the processing options listed below:

"CALL_FLAG1_INI_SERVER" - connection to communication process is retrieved from INI file
"CALL_FLAG1_INI_LOGIN" - login data is retrieved from INI file
"CALL_FLAG1_INI_USEMSL" - converts variable message parts to a complete message text
"CALL_FLAG1_INI_USEALL" - settings made in the INI file section [GLOBAL] are used
"CALL_FLAG1_TRC_HANDLE" - for internal CallAPI processing only
"CALL_FLAG1_LOG_HANDLE" - for internal CallAPI processing only
"CALL_FLAG1_INI_FILE" - name of INI file
"CALL_FLAG1_TRC_OUTPUT" - for internal CallAPI processing only

unsigned long [4]

lUnused1

Not used

unsigned long

Output

Not used

unsigned long [4]

lUnsued2

Not used

unsigned long

lScriptRunNr

RunID of the script

unsigned long

lRetCode

Return code of script execution

char [256]

cRetText

Variable message part explaining the return code's value

char*

pIniFile

Path and name of INI file

unsigned long

hZuLog

For internal CallAPI processing only

unsigned long

hZuTrc

For internal CallAPI processing only

unsigned long

hZuHlp

For internal CallAPI processing only

unsigned long [11]

lUnused3

Not used

void*

pOwnPointer

For internal CallAPI processing only

 

See also:

About the CallAPI

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH