DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Dealing With Expected and Unexpected Faults in BPEL

Dealing With Expected and Unexpected Faults in BPEL

Gabriel Campbell user avatar by
Gabriel Campbell
·
Mar. 05, 12 · Java Zone · Interview
Like (1)
Save
Tweet
3.19K Views

Join the DZone community and get the full member experience.

Join For Free

in bpels in websphere integration developer we can catch exceptions – faults from a bpel, like during an invoke for example.

image

what happens when we want to catch an exception that is not necessarily a fault and could stem from the underlying  system or the application behind the invoke(in the diagram it is invokesomeoperation)?

as you can see in the above excerpt of a bpel, we have a known fault called myapplicationfault in the catch and then in the catch all we deal with any unknown faults that are not myapplicationfault and just exceptions that are not bpel faults at all.

so if we have a numberformatexception for example it will pass the myapplicationfault catch and go the catch all.

now if we want to transform any exception that comes through in a bpel exception that will be like a fault we can use an anonymous class in a snippet:

new bpelexception(){

    public string getfaultname() {

    return “myfaultname”;

    }

    public string getmessage() {

    return caughtexception.getmessage();

    }

};

 

this way we can handle the exception elsewhere in the bpel process using:

com.ibm.bpe.api.bpelexception bpelexception = getcurrentfaultasexception();

logger.debug(“fault name” + bpelexception.getfaultname());

bpelexception.printstacktrace( system.out);

throwable rootcause = bpelexception.getrootcause();

so the catch all can accept normal java exceptions as well as bpel faults smile

from http://gabrieljeremiahcampbell.wordpress.com/2012/02/29/catching-expected-and-unexpected-faults-in-bpel/

Fault (technology)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Build a Business-Led API Strategy and Get the Most Out of Your APIs
  • Writing Beautiful, Optimized, and Better .NET Code With NDepend Static Analysis
  • The Best Team Ever
  • Edge Computing: Implementation, Advantages, and Disadvantages

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo