| Previous | Next |  | Contents | Index | Glossary

## CONTEXT

Syntax

`procedure CONTEXT`

        (pkg_name  IN VARCHAR2,

         proc_name IN VARCHAR2,

         arg1      IN VARCHAR2 DEFAULT '*none*',

         arg2      IN VARCHAR2 DEFAULT '*none*',

         arg3      IN VARCHAR2 DEFAULT '*none*',

         arg4      IN VARCHAR2 DEFAULT '*none*',

         arg5      IN VARCHAR2 DEFAULT '*none*');

Description

Adds an entry to the error stack to provide context information that helps locate the source of an error. Use this procedure with predefined errors raised by calls to TOKEN( ) and RAISE( ), with custom-defined exceptions, or even without exceptions whenever an error condition is detected.

Arguments (input) | pkg_nameName of the procedure package.
proc_name | Procedure or function name.
arg1 | First IN argument.
argn | nth IN argument.

Example 1

`/*PL/SQL procedures called by function activities can use the WF_CORE APIs to raise and catch errors the same way the Workflow Engine does.*/`

    package My_Package is

    procedure MySubFunction(

      arg1 in varchar2,

      arg2 in varchar2)

    is

    ...

    begin

      if (<error condition>) then

        Wf_Core.Token('ARG1', arg1);

        Wf_Core.Token('ARG2', arg2);

        Wf_Core.Raise('ERROR_NAME');

      end if;

      ...

    exception

      when others then

        Wf_Core.Context('My_Package', 'MySubFunction', arg1, arg2);

        raise;

    end MySubFunction;

    procedure MyFunction(

      itemtype in varchar2,

      itemkey in varchar2,

      actid in number,

      funcmode in varchar2,

      result out varchar2)

    is

    ...

    begin

      ...

      begin

        MySubFunction(arg1, arg2);

      exception

        when others then

          if (Wf_Core.Error_Name = 'ERROR_NAME') then

            -- This is an error I wish to ignore.

            Wf_Core.Clear;

          else

            raise;

          end if;

       end;

       ...

    exception

      when others then

        Wf_Core.Context('My_Package', 'MyFunction', itemtype, itemkey, to_char(actid), funmode);

        raise;

    end MyFunction;

### See Also

TOKEN

RAISE

| Previous | Next |  | Contents | Index | Glossary