DZone
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
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations

Dealing With Expected and Unexpected Faults in BPEL

Gabriel Campbell user avatar by
Gabriel Campbell
·
Mar. 05, 12 · Interview
Like (1)
Save
Tweet
Share
3.34K 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

  • Multi-Cloud Integration
  • How To Choose the Right Streaming Database
  • DevOps for Developers: Continuous Integration, GitHub Actions, and Sonar Cloud
  • 11 Observability Tools You Should Know

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • 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: