-
1. Re: Help on Best Practice
kukeltje Aug 31, 2007 8:50 AM (in response to tweedledee)If did the latter once, not because it is a good practice, but just because it worked and did not look to bad as an implementation
-
2. Re: Help on Best Practice
tweedledee Aug 31, 2007 10:44 AM (in response to tweedledee)Ronald,
Thanks for the reply.
I'm wrapping my calls to jBPM in a stateless session bean so if I want to pass back any validation exceptions I would need to return the exceptions from the process variables as an array rather than just throwing an exception from the method.
Alternatively, I guess I could create a custom exception that contained multiple validation exceptions and throw that from the method.
What was your experience of implementing this type of handling?
Regards,
Paul. -
3. Re: Help on Best Practice
jim.barrows Aug 31, 2007 3:47 PM (in response to tweedledee)I believe that getting exceptions in the process, for any reason, is a part of the process. It makes sense to make error handling part of that process.
-
4. Re: Help on Best Practice
tweedledee Sep 1, 2007 7:24 AM (in response to tweedledee)Hi Jim,
So what approach would you advocate in passing business-level exceptions back to the UI Layer?
Regards,
Paul. -
5. Re: Help on Best Practice
kukeltje Sep 1, 2007 8:16 AM (in response to tweedledee)well, there are differences between engine exceptions and businessservice exceptions. The latter in our case were stored in specific processvariables called error__<seq#> they were used to direct the process (e.g. decisionnodes) to nodes where appropriate action could betaken. So that is kind of what I think Jim means by making it part of the process.
It would be nice to get this in a full example though but I'm still waiting for the jBPM book to arrive, might be something in there. -
6. Re: Help on Best Practice
tweedledee Sep 1, 2007 3:54 PM (in response to tweedledee)Ronald,
Do you mean the Business Process Management with JBoss jBPM book by Matt Cumberlidge? I've just finished reading it and it gives a very good overview on both BPM and jBPM with a good starter application. I would have liked to seen more developer oriented topics discussed in greater depth but given the stated audience of the book I guess that wasn't possible.
In my scenario, I need to pass business-level exceptions back immediately after some validation (from the process to the UI layer) within the context of a conversation with a user; I'm using the process as a kind of orchestration mechanism. There are wait states later in the process but the validation step is the first.
My initial thoughts were to create a generic exception similar to SQLException where I could set a code for each business level error and then wrap a collection of these in another exception which would be thrown by my stateless session bean wrapping the jBPM engine.
Regards,
Paul.