Exception Mapping

Introduction

This document describes how to customize the B2B such that exceptions from the workflow handler can be parsed and mapped to a message which is displayed in business logs of the monitor view.

Activation

The mapping is activated if the extension “B3P_EXCEPTION_MAPPINGS” is added. But without a mapping condition (explanation later) there is no visible effect.

Short Description

We assume that an action throws an exception during the workflow of the B2B. Then this could be displayed like that:

For the most users this messages are hardly readable. Such that we provide the possibility to map this error windows into a business log which can been seen here:

The general structure of this message is that in the beginning is an introduction. Then comes in the middle part at least one translation and in the end an epilog. Of course introduction and epilog can be empty.

Customizing

How to creating an extension which creates the above business log based on the given exception of the image above will be explained in this chapter. But at first we will present a more general description of the extension “B3P_EXCEPTION_MAPPINGS”.

Introduction=A short text in the beginning of the log which is the same
for all mapped exception

Epilog= A short text in the end of the log which is the same for all
mapped exception

Exception1.Class=”ALL” or a list of (e.g.
org.b2bbp.runtime.actions.internal.ContrlAction13d) separated by “,”

Exception1.Condition=List of strings which are contained in the
exception or not(string) separated by “,”

Exception1.Translation=A short text which is displayed if the class and
the condition matches.

The key Exception1 can be some word which does not contain “.”.

For every of this key the prefixes Class, Condition and Translation need to be specified. If Class is set to “ALL” then Class has no effect. Else the classes in the list are defined as filter. If the class which has thrown the exception is not part of the Exception1.Class then Exception1.Translation will not be displayed in the business log.

In the example the exception is thrown by the classorg.b2bbp.runtime.actions.internal.ContrlAction13d. Assume the customizing of the extension is:

Exception1.Class=org.b2bbp.runtime.actions.internal.CorrectUNTAction,org.b2bbp.runtime.actions.internal.EdiMessageCheck

Then theException1.Translation will not be displayed.

Assume the customizing of the extension is:

Exception1.Class=org.b2bbp.runtime.actions.internal.CorrectUNTAction,org.b2bbp.runtime.actions.internal.ContrlAction13d

Then we have to check the conditions:

Exception1.Condition contains a list of keywords which need to be in the exception or must NOT be in the exception if the is surrounded by not(). The list is comma separated and all of the elements of the list need to be true. Then the Exception1.Translation will be list in the business logs.

For example we have the following exception (substring of the Figure 1)

Caused by: org.b2bbp.runtime.actions.ActionException: Missing required
information to create CONTRL message

               at
org.b2bbp.runtime.actions.internal.ContrlAction13d.execute(ContrlAction13d.java:181)

               at
org.b2bbp.runtime.JavaInvocationHandler.invoke(JavaInvocationHandler.java:51)

               at
org.b2bbp.runtime.ActionInvocatorHandler.invoke(ActionInvocatorHandler.java:84)

               at
org.b2bbp.runtime.WorkflowHandler.executeAction(WorkflowHandler.java:551)

               ... 3 more

Assume we have the following customizing:

Exception1.Class=Missing required information, not(EdiMessageCheck)

Then the content ofException1.Translation will be displayed.

Assume we have the following customizing:

Exception1.Class= Missing reXDSed information

or

Exception1.Class= not(Missing required information)

Then the content Exception1.Translation of will not be displayed.

Example Extension

Introduction=Es sind folgende Fehler aufgetretten:

Epilog=Bitte benachrichtigen Sie die zuständige Person


Exception1.Class=ALL

Exception1.Condition=Missing required information, not(Das nicht)

Exception1.Translation=Hier seht ein Vorschlag um Fehler zu beheben. Mit
\\n können auch Zeilenumbrüche hinzugefügt werden\! Und es geht
natürlich auch \\t zum Einrücken.


Exception2.Class=ALL

Exception2.Condition=Missing required information, Das hier steht nicht
in der Exception

Exception2.Translation=Hier seht eine Fehlermeldung die jedoch nicht den
Fehler mapped

FAQ

Question: Why do we need the Exception1.Class part?

Answer: Nothing is more obstructive in the error correction as a wrong hint. So making the mappings only for one class reduce the probability for match a wrong exception very strongly. Best example is the mapping for the condition “java.lang.NullPointerException” nearly every complex action can throw this exception. So we can use Exception1.Classfor reducing this condition at least to a class.

View Me   Edit Me