cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.11 - How to create a System Error in SXMB_MONI using a Java Mapping

michael_buchli
Participant
0 Kudos

Hi

We ve go a Java Mapping in a File-to-HTTP Scenario. It works perfect except of one error case: if an empty source file or a source file with the wrong structure is delivered. In this case our Java Mapping forwards an empty payload to the HTTP channel. So, for PI is the mapping successful.

I'd like to recognize this case and invoke a system error in the SXMB_MONI, so that this mapping will be stopped and our alerting concept informs the users. I know, how to recognize the case in Java but need to know how to create the System Error Status in the PI System.

Thanks in advance

Michael

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi Michael,

Please refer here for the mapping API description:

http://help.sap.com/javadocs/NW04S/SPS09/pi/com/sap/aii/mapping/api/package-summary.html

You can use the StreamTransformationException exception describet there to raise an error from your Java mapping. Direct link:

http://help.sap.com/javadocs/NW04S/SPS09/pi/com/sap/aii/mapping/api/StreamTransformationException.ht...

You might also consider using the "Empty-File Handling" option in sender file CC to avoid processing empty files by PI.

Hope this helps,

Greg

Answers (2)

Answers (2)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

please be aware that from java mapping you cannot put any kind of description into your error

but you can do it as per my blog:

https://weblogs.sdn.sap.com/pub/wlg/6398

Regards,

Michal Krawczyk

michael_buchli
Participant
0 Kudos

Hi all

Thanks a lot for your quick and helpful response. I will check your proposals and let you know which suits best.

Michael

Shabarish_Nair
Active Contributor
0 Kudos

you can always handle the logic and throw a StreamTransformationException that will terminate the mapping and result in an exception/error in mapping

http://help.sap.com/javadocs/pi/pi711sp03/index.html