cancel
Showing results for 
Search instead for 
Did you mean: 

PI: Throw Expception to stop message processing during java mapping

Former Member
0 Kudos

Hello,

we have a scenario were we need to compare several input values. In some cases there will be no resutlt message created.

Is there anyway to stop a message processing during runtime if a specified condition is true?

I currently tried it with the code:

if  (!hasMatchFound) //

     throw new Exception("No result!");

But this message doesn't quite the mapping. Is there any other way for this?

regards

Christian

Accepted Solutions (0)

Answers (5)

Answers (5)

steve_coombes
Participant
0 Kudos

Hello Christian

Throwing an exception should stop the mapping. Are you sure the condition is being met?

Could you add some logging in the UDF to be sure the exception is being thrown?

regards

Steve

iaki_vila
Active Contributor
0 Kudos

Hi Christian,

There are a couple of blogs that you should check to get your goal in the best way:

Michal Krawczyk's blog: http://scn.sap.com/community/pi-and-soa-middleware/blog/2007/04/26/xipi-throwing-generic-exceptions-...

Alessandro Guarneri's blog:

Regards.

0 Kudos

Hi Christian,

please try the following code:

throw new RuntimeException("Your error message here");

This works fine for us. The mapping terminates with an error and the exception is shown in the trace.

Best regards,

lars

RaghuVamseedhar
Active Contributor
0 Kudos

Christian,

Is there any catch block, which is handling Exception?

Can you paste the Java mapping here? We can guide you.

former_member184720
Active Contributor
0 Kudos

Did you try

throw new StreamTransformationException( "No result!");