Executing C API programs in workflow


The most obvious way to execute a C API program is from the command line. You can execute a C API program directly, integrate it with other processes or commands in a shell script, or schedule it for regular execution by using a UNIX cron job or the Windows Scheduler.

You can also execute a C API program through a workflow. You can call a C API program in a filter, escalation, or active link to perform the Set Fields, Push Fields, or Run Process actions.

Set Fields and Push Fields

The Set Fields and Push Fields actions assign a specified value to a particular schema field. You can assign a constant, a value from another field, or an operation result value (see Set-Fields-action-and-structures or Push-Fields-action-and-structures). To assign the result of an operating system process or command (including a C API program), specify the following field value:

$PROCESS$ APIProgram parameters

The Set Fields and Push Fields operations block the AR System server (the server waits for the operation to complete before performing any other actions). If the Set Fields or Push Fields action calls a C API program that executes on the same AR System server, a deadlock could occur if there are no multiple server threads to handle calls. When only a single server thread is configured, the server cannot respond to the request from the API program until it completes the current operation, but the server cannot complete the operation until it executes the API program.

This deadlock causes a time-out, and the Set Fields or Push Fields operation fails. To avoid this problem, when running your API program against the same server, configure your server to have multiple fast and list server threads. 

Important

The default process time-out interval is five seconds. You can adjust this setting by using the AR System Administration: Server Information form. Valid values are from 1 to 60 seconds.

Run Process

The Run Process action executes the specified operating system process or command. To execute a C API program, specify the following as the command value:

API Program parameters

Unlike a Set Fields operation, the Run Process action does not block the AR System server. The system places these tasks in the Run Process queue, where they are deferred until the server has completed all database transactions.

If the specified process requires a field value (for example, sending a pager message to the user to whom a particular ticket has been assigned), the server might use different values depending on the type of database operation and whether it was successful. The following table summarizes the possible scenarios:

If the specified process does not require a field value (for example, sending a pager message to a particular user), the server does not execute the queued processes after an unsuccessful database transaction.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*