Event handler and parsing the pipeline

Hi, I have 4 message types, 3 outgoing from R/3, and 1 going to R/3, from SAP BC.

I want to set up Event Handler Flow code to capture service errors such as: Out-of-memory; numeric format error; etc…

In my error handler Flow code I receive the pipeline of the failing service into a file called ‘X’. This includes system info plus the actual ‘pipeline’ from the failing service.

My question is how to parse this actual ‘pipeline’ info into a record to determine the service that is causing the error, and secondly how to retrieve that info from the xml style pipeline to grab the pertinent xml values to output to an email generated by the smtp service?

In the developer I used File->New->Record function to create a record based on ‘X’.

Am I confused or what?

What I want to accomplish is that when the Event Handler is triggered and it invokes a specific Event Handler Flow pgm, sending a specific pipeline that includes the failing services ‘pipeline’, I need to know the best way to parse that ‘pipeline’ so I can determine which service originated the exception.

Anyone have any sparks of brilliance to help me here?

Regards, Stephen Young in Toronto, Canada.

P.S. I am desperate. I have Toronto Bus Tickets to give away!

The pipeline is sent to the error handling service as an IData object. You will need to write a Java Service that takes the “pipeline” IData object as input and parses it (create an IData Cursor, position the cursor, assign pipeline values to variables, put the variables back into the pipeline, and destroy the IData Cursor). Call this Java service from within your error handling service and you will get your data.

Hope this helps,
David Rodgers

Hi Spy,
Let me see if I understand your requirement.
You are using SAP BC means you are at IS version4.6.

When a Flow service implements a Try/Catch Sequence and adds the getLastError in the Catch Sequence, it has the lastError IDATA Record available.

Looks like in your case this flow service already does the further steps in its Catch block and writes the pipeline and failing service name in a file and supplies the filename to your Event Handler service your trying to code.

If that is the case, in your Event Handler service read this file, convert bytes to string and see if you find, there is a lastError/error string which has the cause of failure.

Based on the structure of that file, you can extract this value to do whatever you want.

HTH,
Bhawesh.