Reaction Process Definitions

A reaction Process Definition is a Process Definition that is executed in response to specific conditions. You might, for example, want to create a reaction Process Definition that generates an email or an Operator Message if a Platform Agent Process Server runs a check on an Oracle database and that check fails.

There are several types of reaction Process Definitions:

  • Any: Can be called from a Process Server as well as remote systems.
  • Check: Can be called automatically when a Platform Agent Process Server with a Check configured fails the check.
  • Pusher, Push Acceptor, and Promote Further Pusher: Because these are specific to the Promotion Module, they are covered in Promotion Reaction Processes.

Any Process Definition can be a reaction Process Definition. To configure a Process Definition as a reaction process, display its Options tab and then choose an option from the Reaction Process Type dropdown list.

When you choose a Reaction Process Type, the Parameters tab is automatically populated with the available parameters for that reaction process type. Note that this may overwrite existing parameters, so be sure to choose a Reaction Process Type at the beginning of the process. The screen shot below shows the Parameters tab after the Any reaction process type is selected.

All reaction process types use the following set of parameters. Specific reaction process types may have additional parameters.

  • Address: The address to use. For promotion reaction processes, this is the URL of a different RunMyJobs instance (see Working with Remote Systems).
  • Data:A free form expression.
  • Message: An optional message.
  • Source Object: The name of the source system that triggered the reaction process.
  • Source Object Type: The object type of the source system that triggered the reaction process.
  • Source Object UniqueId: The unique ID of the source system that triggered the reaction process.

In addition, Process Definitions have a set of parameters that are filled automatically by the caller, so there is no need to write REL expressions to supply the parameters. Reaction processes have the following automatically-filled parameters:

  • SourceObject: The name of the object that called the reaction process.
  • SourceObjectUniqueId: The unique ID of the object that called the reaction process.
  • SourceObjectType: The type of the object that called the reaction process.
  • Address: The destination/recipient address.
  • Data: A free-form expression.

Defining a Check Reaction Process Definition

When you create a Process Server Check on a Platform Agent Process Server, you can specify the reaction Process Definition to be called if that fails. To do so, choose the reaction Process Definition's name from the Process Definition dropdown list in the Process Server's Checks tab.

Example Reaction Process Definitions

Reaction Process Type Any

This example is a CMD script that handles some types of MS SQL database service outages.

Copy
net start MSSQLSERVER 2>&1|FIND "2182"
IF %ERRORLEVEL% 1 goto :already_started

echo "service was stopped, has been restarted"
sc query MSSQLSERVER
exit /b 0

:already_started
echo "service was already started, attempting to restart it"
net stop MSSQLSERVER 2>&1 |FIND "HELPMSG"
IF %ERRORLEVEL% 1 goto :start_sql

:failure
rem get state of service and exit, manual intervention required
sc query MSSQLSERVER
exit /b 1

:start_sql
net start MSSQLSERVER 2>&1 |FIND "HELPMSG"
IF %ERRORLEVEL% 1 exit /b 0
goto :failure

Reaction Definition Type Check

This example is a simple CMD script that reboots MS Windows Servers.

Copy
shutdown /r /f /c "Restarted by central process automation" /d u 254:254