Executing C API programs in workflow
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.
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.