cancel
Showing results for 
Search instead for 
Did you mean: 

BPM exception

Former Member
0 Kudos

I have a synchornous (request,response and fault) send step in BPM. If the target system sends fault I raise an exception in BPM. In the exception branch I have a seperate mapping(transformation step) to send an alert email to target audience.

The question is how do I pass the fault message field content to this transformation step. Can that be done using parametrized mapping? or any other way?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184720
Active Contributor
0 Kudos
Former Member
0 Kudos

Hareesh,

Going by the above blogs...loooks like fault message content cannot be read in bpm without using the approach mentioned by alex.

But just a thought...my request, response and fault mapping is happening outside the bpm. So there are no async abstract interfaces defined for either the source or target synchronous interfaces. But can I export the value of fault message and import it in BPM some how so that I can use it for other transformation steps I am doing in the BPM.

Your thoughts....

Former Member
0 Kudos

Hi Vicky

You can trigger the alert email in the below way also

Write an UDF in your fault message mapping and inside the udf call the function module SALERT_CREATE

sample code:


java.util.Map map;

try {

String msgid;

map = container.getTransformationParameters();

msgid = (String) map.get(StreamTransformationConstants.MESSAGE_ID);

Channel channel = LookupService.getChannel("test00","CC_RFC_R_PI");

RfcAccessor accessor = LookupService.getRfcAccessor(channel);

String rfcXML= "<ns0:SALERT_CREATE xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\">"+

      "<IP_ALIAS/>"+

      "<IP_APPLICATION_GUID/>"+

      "<IP_CAT>ALERT_TEST_UDF</IP_CAT>"+

      "<IP_XML_CONTAINER/>"+

      "<IT_CONTAINER>"+

         "<item>"+

            "<ELEMENT>ZCUSTOMER</ELEMENT>"+

            "<TAB_INDEX>0</TAB_INDEX>"+

            "<ELEMLENGTH>20</ELEMLENGTH>"+

            "<TYPE>C</TYPE>"+

            "<VALUE>"+pnum+"</VALUE>"+

         "</item>"+

           "<item>"+

            "<ELEMENT>ZMSGID</ELEMENT>"+

            "<TAB_INDEX>1</TAB_INDEX>"+

            "<ELEMLENGTH>70</ELEMLENGTH>"+

            "<TYPE>C</TYPE>"+

            "<VALUE>"+msgid+"</VALUE>"+

         "</item>"+

      "</IT_CONTAINER>"+

    "</ns0:SALERT_CREATE>";

InputStream inputStream =new ByteArrayInputStream(rfcXML.getBytes());

XmlPayload payload = LookupService.getXmlPayload(inputStream);

Payload rfcOutPayload = accessor.call(payload);

throw new  StreamTransformationException ( " Message Mapping Failed because of invalid Customer number");

}

catch(Exception e)

{

  throw new RuntimeException("Exception while checking for Distribution channel : "+e);

}

Former Member
0 Kudos

Hi Vicky

Why you are creating the mapping for triggering alert. You can create an alert category and use the same in control step to trigger the alert email.

Create a container variable in BPM and then use assign step to assign the xpath of the fault message fields. Then in the alert message you can use the container variables.

Former Member
0 Kudos

Can you tell me something more about assign step?

Former Member
0 Kudos

Hi Vicky

The assign step is used like a variable declaration step in BPM. You have choose the step called 'Container Operation' .

Target : container variable that you have created

Operation : Assign

Expression :  The xpath of the field value that you want to assign

Former Member
0 Kudos

Great. Thanks...but the xpath can be defined only for async abstract interfaces right?

I have a synchronous send step....that means my mapping is happening outside of BPM. So there is no abstract interface defined for the fault message from where I need to extract the value.

Former Member
0 Kudos

Hi Vicky

Please create an abstract asynchronous interface for your fault message. Then create container variable and assign the xpath.

Former Member
0 Kudos

How do you create a abstract async interface for fault message...shouldn't it be associated with its request and response message? Is this how you are mentioning.

Also, do i need to create corresponding directory objects as well for abs falut message interface?

Just finished testing it...it doesn't work..

Former Member
0 Kudos

Hi Vicky

Have u got the response back as a fault message during synchronous send step ?

If u got the response message type as response, then the container variable should be filled up

with the value that came in response . The alert email should also displayed the same.

Also I am curious to know how you are performing the synchronous send step with out creating the abstract interface for sync and request ,response messages?

Former Member
0 Kudos

I have a seperate fault message in the interface so the fault response from the traget system comes in fault message not in response message.

I am calling the abs sync message in synchronous send step. But beacuse its a sync abs interface, I cannot create a container variable for the fault message.