February 7 2010

Inside Oracle BPM logic, you can catch exceptions using logic like this:

try {
    MyJavaClass.method(arg1 : arg);
}
catch (NullPointerException e) {
    logMessage("it's a null");
}
catch (Exception e) {
    logMessage("it's an exception");
}
catch (Any e) {
    logMessage("it's an Any");
}


If I'd left off the "NullPointerException" try/catch block, it would have been caught by the "Exception" try/catch block. If I'd left off both of these it would have been caught by the "Any" try/catch block.

If you test the logic from the Workspace you won't see the confusing dialog come up that an uncaught exception occurred. If you instead run your logic from the method editor's debugger, you'll see what appears to be an uncaught exception. If you're running the logic from the method editor's debugger, be sure to click the "Throw" button. If you do this, it will be caught appropriately (in my case in the NullPointerException try/catch block).

About the Author

Dan Atwood

Dan has more than sixteen years of experience in all phases of design, development, and implementation of software applications using BPM. He has developed Oracle BPM, BAM, business rule and integration solutions for financial services, insurance, food cooperative, and telecommunications clients.

Join the Conversation

Enter your first name. It will only be used to display with your comment.
Enter your email. This will be used to validate you as a real user but will NOT be displayed with the comment.
By submitting this form, you accept the Mollom privacy policy.