How can I access the exception message in a exception start process element?

Original Question (in German only):

Ich versuche für unsere Studierenden (Unterricht an der ZHAW) eine möglichst generische Fehlerbehandlung aufzuzeigen. Folgendes schwebt mir vor:

  1. Siehe erstes Bild. Pro Prozess füge ich einen Pool 'Fehlerbehandlung' (1) mit einem Lane pro Fehlerquelle hinzu (z.B. 'DB Step Exception) (2)
  2. In diesem Lane gibt es ein Exception Start-Element (3)
  3. Innerhalb des Prozesses kann ich nun überall dieses Start-Element als Exception Handling verwenden, wo es passt (4, 5, 6)
  4. Das Exception Handling selbst soll zunächst einmal darin bestehen, eine aussagekräftige Fehlermeldung anzuzeigen. Hierfür habe ich einen prozessübergreifenden Subprozess 'DisplayErrorPage' erzeugt (zweites Bild)
  5. Innerhalb dieses Subprozesses möchte ich nun in Abhängigkeit des aufgetretenen Java-Fehlers (siehe zum Beispiel drittes Bild) über eine unterschiedliche Fehlermeldung reagieren. Zu diesem Zweck müsste ich aber programmatisch irgendwie auf die Error Message (z.B. drittes Bild) zugreifen können. Wie kann ich dies bewerkstelligen? Ich vermutete zunächst, dass dies ein Objekt in der ivy-Hierarchie ist, fand aber nichts.

Ich wäre sehr froh um eine Antwort bis 13.11. 12 Uhr, damit ich rechtzeitig ein Video für die Studierenden erstellen kann.

A B C

asked 11.11.2013 at 16:04

Bj%C3%B6rn's gravatar image

Björn
(suspended)
accept rate: 100%

edited 12.11.2013 at 09:40

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857

Dear Björn

Please write questions in english so that users that don't understand german also can read and search it.

Regards

(11.11.2013 at 16:51) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

In the inscription maks of the process element exception start a variable called exception is available that contains the error message. You can assign the variable to a field in your process data as follows:

out.errorMessage = exception;
link

answered 11.11.2013 at 16:54

Reto%20Weiss's gravatar image

Reto Weiss ♦♦
4.9k202857
accept rate: 74%

Dear Reto

Thanks for your answer. It works, but I only get the message without details. I would like to get the whole exception object from the runtime log to be flexible enough. But I don't know, how to get this logEntry. There are so many entries, when I search for 'log' in the Data Type Browser - which class to choose (ch.ivyteam.log!? org.apache.log4j!?) and how to use?

Kind regards Björn

(12.11.2013 at 09:22) Björn Bj%C3%B6rn's gravatar image

Hi Björn

Unfortunately it is at the moment not possible to access the exception object itself. Only the exception message is available.

It is also not possible to get a log entry object for the exception because on the server the log is written to a file an not kept in memory as it is on the designer runtime log.

We know that this is a shortcoming of Xpert.ivy. We plan to improve exception handling in one of the upcoming releases.

Regards

Reto

(12.11.2013 at 09:38) Reto Weiss ♦♦ Reto%20Weiss's gravatar image

Hi Reto

Thanks for your explanation. I will work with the limitation and I am looking forward to the improvement.

Björn

(12.11.2013 at 13:01) Björn Bj%C3%B6rn's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×8

Asked: 11.11.2013 at 16:04

Seen: 6,480 times

Last updated: 12.11.2013 at 13:01