Error handler

Error handler

This advanced other workflow component, Error handler, sets which workflow to call if an error should occur during processing.

 

This is similar to the On error workflow on the workflow inputs. An alternative or addition is the general error report email option for the whole tenant.

 

The error handler workflow component selects which workflow to call in case of an error. It works for the workflow sub-tree starting with this component - until another error handler is found. An error handler overrules the optional On error workflow, that can be setup on the workflow input.

 

Here is an example of how to move files to an error folder, if an error occurred. You can also use an error handler in the main workflow in that.

 

The error handler has this parameter:

 

NG2WorkflowErrorHandler0001

 

On error workflow

Here you select (via a drop down list) the other workflow, that is to be called from now on, if an error should occur.

The other workflow must be created first, and the other workflow need to have the input type, From other workflow in order to be listed here.

 

 

Hints for usage

Here are a couple of hints of how you can make full use of error workflows:

 

Keep the initial payload for the error workflow

An error workflow can be triggered at any stage in the main workflow so the payload may have been changed from the original input file e.g. into a PDF or PCL payload. If you want to make it possible for the error workflow to be able to 'see' the original input file, then you should consider to add the component, Payload to named property in the main workflow before any error might occur and then in the error workflow use the component, Named property to payload to copy the original payload back into the payload in the error workflow.

 

 

Find out which workflow ran when the error occurred

You might want to know the name of the workflow that ran when the error occurred - in the error workflow. That information is not directly available, but you can setup your workflows to make this known. An important part of this is the predefined variableinterform.workflow.name. This variable always contains the name of the workflow, that is currently running. Unfortunately the value of this variable also changes to the name of the error workflow, then an error triggers it. So you need yourself to make sure to save the name of the original workflow before the error can occur. You can do that e.g. if you define your own variable and copy the value of interform.workflow.name into it in the main workflow. Then you can retrieve the name of the original workflow in the error workflow by using your own variable.

 

So here you could add this workflow component in the main workflow:

 

NG2ErrorHandler0002

 

And then refer to the variable, OriginalWorkflow in the error workflow.

    • Related Articles

    • Error workflow component

      The workflows, that you can setup in InterFormNG2 can be very long and complex and in some cases e.g. for debugging you might want to force an error in the workflow. Another reason why you might want to force an error, could e.g. be that an input XML ...
    • Workflow: How to move files into an error folder

      When InterFormNG2 is processing files from a folder, then it will process the input files like so: The files are moved into the processing folder, when InterFormNG2 starts to process the files, and they are moved into the processed folder, when they ...
    • Advanced Other workflow components

      The list of advanced other workflow components is: 1.AS400 Print Attribute Options. Use this to set various spooled file attributes of the merged spooled file on the IBM i platform. 2.Change attributes of spooled file. Use this component to change ...
    • Validate XML against XSD

      This advanced validation workflow component, Validate XML against XSD, can validate XML according to rules. This component can validate an XML file against an schema definition (XSD). This component takes XML as input. The component throws an ...
    • ANY

      ANY : ANY is one of the file types/payloads referred to in the workflow of InterFormNG2. In short it means, that the related workflow component accepts any kind of input. This ANY payload is referenced in these types of workflow components: ...