cancel
Showing results for 
Search instead for 
Did you mean: 

trigger email when exception raises

former_member190996
Participant
0 Kudos

Hi,

The interface that I'm working on is MQ -> PI <-> SOAP. Between MQ and PI it's Asynchronous, we are only reading the messages from MQ.

But on the receiver side between PI and SOAP it's synchronous. Please see it below:

When the response from SOAP is something else other than the 'Success', I need to trigger an email with the response as the email body. Can you please let me know how can I achieve this?

Thanks,

Sai

Accepted Solutions (1)

Accepted Solutions (1)

apu_das2
Active Contributor
0 Kudos

Hi Sai ,

I think you need to use Sync async bridge for this ... You can use Control step to trigger mail in case of exception.

Thanks,

Apu

former_member190996
Participant
0 Kudos

Hi Apu,

Thanks for the response. But can you please elaborate a bit?

-Sai

Former Member
0 Kudos

please follow the below link for this.

Reward if this helps

Thanks-

Answers (1)

Answers (1)

former_member190996
Participant
0 Kudos

I should update my scenario a bit, please check below:

There's no Asynchronous Inbound response interface from the receiver, do I still have to do the Async-Sync bridging? It's basically a push from MQ to SOAP, but if there are any exceptions at receiver side, in the form of soapresponse (any message other than 'Success'), I have to trigger an email. How can I achieve this?

-Sai

former_member186851
Active Contributor
0 Kudos

Hello Sai,

Do you have any mapping program for response.

If yes why dont you configure alerts and trigger an e-mail

nitindeshpande
Active Contributor
0 Kudos

Hello Sai,

What you have to do if the message is success?

You need to use Async-Sync Bridge for your scenario, as you are getting synchronous response from your 3rd party and you need to convert it into Async.

You can use RD condition or ID condition to route the messages when you have Success or Error. Basically you need to use two different inbound interface and If Error you can use the mail package and send the email alert and if it is success then you can chose the action to be done.

Regards,

Nitin

former_member190996
Participant
0 Kudos

Hi Nitin,

What you mentioned above is exactly what I have to achieve. The below is more detailed flow of the scenario:

  1. Now, I have changed the module configuration at the SOAP receiver communication channel as below:

     2. I have created two new inbound interfaces to handle the response (Step. 3) from the Receiver 1. One to handle the error messages, which is to send that response message an email and another to handle the success message, which is to close the message.4

Now, can you please let me know how to handle the RD and ID to accommodate these interfaces? Also, please let me know if I'm not clear with details.

I have done the above changes by following this blog:

Appreciate your help.

nitindeshpande
Active Contributor
0 Kudos

Hello Sai,

What is the data you are getting in the response? How do you determine whether the response is Success or Error? Is there any field which says Success or Error. If yes, then you can use Xpath condition to route it to particular receiver, if the receiver's are different or else route it to different inbound interfaces in ID.

I do not know, what you wanna do if the message is success, based on what to do you can route the message if success.

Regards,

Nitin

former_member190996
Participant
0 Kudos

Hi Nitin,

There's only one field coming as response. And the value will be either Success or the list of error messages. So, the condition I am planning to put is != Success. Should I put these in the receiver determination?

Regards,

Sai

nitindeshpande
Active Contributor
0 Kudos

Hello Sai,

What is the system you want to send when the message is Success and when it is Error? If the systems are same, then you must use it in Interface determination. If they are different, then you must use it in Receiver Determination.

Regards,

Nitin

former_member190996
Participant
0 Kudos

Hi Nitin,

I have to send an email if it's error and do nothing or close the message, if it's success. Do I have to create a new mail communication channel? I know, I am getting into too much details.

Regards,

Sai

former_member190293
Active Contributor
0 Kudos

Hi Sai!

In your response part you can use condition in Receiver Determination to set Receiver system if contents of response message not equals to "Success" and to drop message otherwise.

If you don't need to transform response message for e-mail receiver, you may use dummy interface for receiver in receiver determination since you don't need any operation mapping. You only have to set mail receiver communication channel for receiver system.

Regards, Evgeniy.

former_member190996
Participant
0 Kudos

Hi Evgeniy,

Thanks a lot for your response.

In the Receiver Determination, there's Outbound interface as Operation which does not have the response message. How should I bring that response message to the receiver determination?

Regards,

Sai

former_member190293
Active Contributor
0 Kudos

Hi Sai!

You created outbound async Interface with SOAP response message type for sending SOAP response (as you use async-sync adapter bridge).

In Receiver determination choose "Condition" field and set XPath expression according to your response message structure:

and set business system with mail communication channel as receiver for this condition.

Regards, Evgeniy.

former_member190996
Participant
0 Kudos

Hi Evgeniy,

Sorry for the late follow-up.

I have the outbound async interface, with the SOAP response that I'm getting from the receiver. Now, should I create a second receiver determination with condition?

Regards,

Sai

former_member190293
Active Contributor
0 Kudos

Hi Sai!

No, you don't have to create other receiver determinations.

In your existing receiver determinarion defined for your Async response sender system/interface just set condition like I showed above and set business conponent with mail receiver channel for that condition. And set "Ignore" option if the receiver not found in receiver determination settings.

Thus, if your response async message doesn't contain value "Success" in element defined in XPath expression the message is routed to receiver with mail communication channel. In other case message is dropped and no further processing takes place.

Regards, Evgeniy.