Creating and using Error processes

An Error process is a special type of process that never runs on its own, and cannot be called using the GoSub or Send to Process tasks. It can only be used in the On Error tab of a task in your process, and will be triggered if the Send to Process option is checked in that tab and an Error process is selected in the drop-down list.

To create an Error process, simply replace the initial input task by the InputErrorBin Input task, and that process automatically becomes able to handle error jobs sent to it. It is up to you, however, to decide how that error job will be handled.

For example, you could place the job file in a specific folder, then send an email to a supervisor indicating that a job has failed. Or you could update a database with an error status so that it appears on a customer's online order. You could also zip the order up and send it to an administrator, while simultaneously advising the person that sent the job that it failed.

You can have as many error processes as you can normal processes - that is, you are limited to 512 processes, subprocesses, startup processes and error processes combined.

Information available in an Error process

The following information is available from within your Error process when it is triggered.

  • A series of variables containing information about the error, the task that triggered it and the process that contained it (see below). These are System variables.
  • Job Info variables (%1 to %9).
  • The data file as it was before starting the task.
  • Global variables (which are, of course, available anywhere).
Local variables in the process are not sent to error processes, even if the error process has a variable of the same name.

Error handling variables

The error handling variables are read only and are filled by the On Error mechanism.
They can be accessed anywhere, but they only appear in the contextual menu of a task property field when the current process is an error-handling process (that starts with the Error Bin Input task). See also: Variable task properties.

Variable

Name

%{error.process} Name of the process where the error was triggered.
%{error.tasktype} The type of task that triggered the error
%{error.taskname} The name of the task that triggered the error
%{error.taskindex} The position of the task in the process
%{error.errormsg} The error message, as entered in the OnError tab of the task.
This is the same message as appears in PlanetPress Workflow Log file.
%{error.errorid} The error ID, as entered in the OnError tab of the task.
This is the same ID that appears in the Windows Event Viewer.

%{error.errorlog}

A string containing the logged error message(s) from a task. Multiple error messages are delimited by a "|" (vertical bar) character.