| Previous | Next |  | Contents | Index | Glossary

## HandleError

PL/SQL Syntax

`procedure HandleError`

        (itemtype in varchar2,

         itemkey in varchar2,

         activity in varchar2,

         command in varchar2,

         result in varchar2);

Description

This procedure is generally called from an activity in an ERROR process to handle any process activity that has encountered an error.

You can also call this procedure for any arbitrary activity in a process, to rollback part of your process to that activity. The activity that you call this procedure with can have any status and does not have to have been executed. The activity can also be in a subprocess, if the activity node label is not unique within the process you may precede the activity node label name with the internal name of its parent process. For example, <parent_process_internal_name>:<label_name>.

If the On_Revisit flag is set to Reset, this procedure clears the activity specified and all activities following it that have already been transitioned to by reexecuting each activity in 'Cancel' mode. See: Looping. For an activity in the 'Error' state, there are no other executed activities following it, so the procedure simply clears the errored activity.

Once the activities are cleared, this procedure resets any parent processes of the specified activity to a status of 'Active', if they are not already active.

The procedure then handles the specified activity based on the command you provide: SKIP or RETRY.

Arguments (input) | item_typeA valid item type.
item_key | A string generated from the application object's primary key. The string uniquely identifies the item within an item type. The item type and key together identify the process.
activity | The activity node that encountered the error or that you want to undo. Provide the label name of the activity node. If the activity node label name does not uniquely identify the subprocess you can precede the label name with the internal name of its parent process. For example, <parent_process_internal_name>:<label_name>.
command | One of two commands that determine how to handle the process activity:
| SKIP--do not reexecute the activity, but mark the activity as complete with the supplied result and continue execution of the process from that activity.
| RETRY--reexecute the activity and continue execution of the process from that activity.
result | The result you wish to supply if the command is SKIP.

> Note: An item's active date and the version number of the process that the item is transitioning through can never change once an item is created. Occasionally, however, you may want to use HandleError to manually make changes to your process for an existing item.

> If the changes you make to a process are minor, you can use HandleError to manually push an item through activities that will error or redirect the item to take different transitions in the process.

> If the changes you want to make to a process are extensive, then you need to perform at least the following steps:

- Abort the process by calling WF_ENGINEAbortProcess( ).

- Purge the existing item by calling WF_ENGINE.Items( ).

- Revise the process.

- Recreate the item by calling WF_ENGINE.CreateProcess( ).

- Restart the revised process at the appropriate activity by calling WF_ENGINE.HandleError( ).

| Previous | Next |  | Contents | Index | Glossary