Skip to Content
Author's profile photo Arijit Mukherjee

Interface specific Email Alert in PO using CBMA

I had a requirement where I needed to send the alert emails to different people based on the interface.In more simple word, for Interface#A I had to send email to csk@xyz.com but for interface#B, I had to send alert email to mno@dfg.com. So basically I had to use CBMA to send email alert but to the different consumer/recipients for different interfaces. So we created the consumer/alert and jobs for Interface#A and repeated the same step for Interface#B.

Here are the steps I performed.

Step1: Create Alert in ID:Assign corresponding objects for which you want to create the alert.In my case, I added one ICO.

/wp-content/uploads/2015/07/pic1_749813.jpg

Now as we want to create a new consumer to be used here in this alert rule, we do not set the consumer name in the Extended tab. Leave it blank and activate(you may get warning after activation of the rule).

/wp-content/uploads/2015/07/pic2_749814.jpg

Step2: Now we need to register the new CONSUMER we want to create along with the ALERT RULE we created in Step1.

To do this, go to Service Registry.

/wp-content/uploads/2015/07/pic3_749815.jpg

Now search for the definition called AlertRuleIn.

/wp-content/uploads/2015/07/pic4_749831.jpg

Now go to Endpoints tab and click on TEST button.

/wp-content/uploads/2015/07/pic5_749838.jpg

A new window will be opened.There you need to click on RegisterConsumer service and Next.

/wp-content/uploads/2015/07/pic6_749839.jpg

On the next page we need to put the exact name of the AlertRule created in ID and the new CONSUMER we want to create.

/wp-content/uploads/2015/07/pic6_749839.jpg

Once you click on Next, you should be able to see a message in XML like below.

/wp-content/uploads/2015/07/pic6_749839.jpg

After this step you should be able to see the CONSUMER added to Alert Rule automatically.

/wp-content/uploads/2015/07/pic6_749839.jpg

Step3(One Off Activity): Now you need to configure Java Mail Client.

NWA>Configuration > Infrastructure > Java System Properties > Services – Java Mail Client.

In properties Tab, provide the mandatory parameters like below.

mail.from

mail.smtp.host

mail.smtp.password

mail.smtp.user

/wp-content/uploads/2015/07/pic6_749839.jpg

Step4: Scheduling a task to send the emails using the new alert/consumer we created(step1,Step2) and the Java mail client configured(step3).

Go to NWA> Operations > Jobs > Java Scheduler > Task.

Add a new Task.

/wp-content/uploads/2015/07/pic6_749839.jpg

Now you need to select the existing consumer job.

/wp-content/uploads/2015/07/pic6_749839.jpg

Click on Next.Here you can provide a suitable task name.

/wp-content/uploads/2015/07/pic6_749839.jpg

Click on Next.

Here you need to set properties.

/wp-content/uploads/2015/07/pic6_749839.jpg

Click on Next.

Here you need to set the start/end time and the frequency at which the Job should run. In my case it is 1 hour.

/wp-content/uploads/2015/07/pic6_749839.jpg

Then click on Add.

/wp-content/uploads/2015/07/pic6_749839.jpg

Now click on Finish and you should be able to see the task created.

/wp-content/uploads/2015/07/pic6_749839.jpg

With this the configuration is completed.

Result: If there any error happened then the recipient should get an email like below.

/wp-content/uploads/2015/07/pic6_749839.jpg

Now repeat the step1 to Step4 (Except Step3)for Interface#B to generate the alert emails to different set of recipients.

If you are not happy with the email body and want get a more readable one then please follow Generate Formatted or structured EMAIL using CBMA

Assigned Tags

      16 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sunil Mavachee
      Sunil Mavachee

      Good one.!

      Not many consultants use 'Services Registry' effectivly. Good work.

      Keep it up.

      Regards,

      Author's profile photo Binod Mondal
      Binod Mondal

      Thanks for your time and putting this so clearly.

      One suggestion: step2 can be avoided by adding the new consumer directly in step1 itself and activating it? This had worked for me so you may please give a try?

      Author's profile photo Arijit Mukherjee
      Arijit Mukherjee
      Blog Post Author

      Thanks Binod. I will surely try it.

      Author's profile photo Former Member
      Former Member

      Hi Arijit,

      Thanks for your post.

      I tried to check AlertRuleIn in Service Registry page, but it is not there. in this case how i create the endpoint in service defenition list. please help me.

      /wp-content/uploads/2016/03/5134_905843.png

      Regards,

      Vijayakumar.B

      Author's profile photo Arijit Mukherjee
      Arijit Mukherjee
      Blog Post Author

      Hi Vijay,

      As stated by Binod Mondal , try writing the name of the consumer(as per your wish) in the consumer section of the alert rule and activate the same. Then you don't need the service registry step.

      /wp-content/uploads/2016/03/pic1_912344.jpg

      Thanks

      Arijit

      Author's profile photo Former Member
      Former Member

      Good work. Keep it up 🙂

      Author's profile photo Former Member
      Former Member

      Hi Arijit,

      Good work, I have Configured Alert Consumer JOb v2 following your thread.

      I have one doubt?

      Is there any way to customize SUBJECT also of Alert Email using Alert Consumer Job V2?

      If yes, how?

      Thanks in Advance.

      Regards,

      Sarvjeet

      Author's profile photo Arijit Mukherjee
      Arijit Mukherjee
      Blog Post Author

      Hi Sarvjeet,

      Sorry I am not sure about changing the Subject.

      Thanks

      Arijit

      Author's profile photo Binod Mondal
      Binod Mondal
      Author's profile photo Former Member
      Former Member

      Hi Arjit,

      It's indeed a good one.

      i am trying to generate the alerts using CBMA for interface specific, it's all working fine and we are able to receive emails.

      however, I have created more than one rule for different set of interfaces  (Rule A - interface A and Rule B - Interface B) and selected check boxes for central integration Engine, Central adapter Engine and ABAP proxy and selected all check boxes for adapter types from Extended tab for both alert rules. i am using different consumers for different alert rules and separate job scheduled for each consumer.

      If  any message failed in ABAP proxy related to interface A, the alert is logging for both alert rules and both consumers are getting same alert email (I am expecting it supposed to trigger alert for rule A only isn't it? and the same way if message failed for interface B then same situation i.e logging alert for all alert rules and sending emails for all consumers.

      Rule A

      RuleAA.png

      RuleB.jpg 

      RuleB:

      RuleBB.png

      RuleA.jpg

      Can you advise is there a way to restrict logging the alert specific to relevant alert ID which the failed message relevant interface listed in?

      Regards,
      Siva.

      Author's profile photo Arijit Mukherjee
      Arijit Mukherjee
      Blog Post Author

      Hi Siva,

      Sorry for delay as I was off for few days! However I would suggest you to post a thread so that every one on the community can help you at any time.

      Looking at the consumer section for both of the Alert Rules, I see the consumer called "ALERT-TO-MAIL" used in both the case and is common. I think that is the reason you are getting combined alerts. If you have 2 different consumer, why do you use ALERT-TO-MAIL? That is a standard consumer.Use the customized consumers respective to rule and set the jobs for them. That should work.

      Thanks

      Arijit

      Author's profile photo Aarthi Vijayaraghavan
      Aarthi Vijayaraghavan

      Hi,

      Nice Blog. Alert Rule can be transported along with other ID objects. How about the Task Setup in NWA? Should that be created manually in each environment?

      Author's profile photo Former Member
      Former Member

      Hi Aarthi

      If the task is the java schedule task, then yes we create it manually.

      Cheers, Faith

      Author's profile photo Former Member
      Former Member

      Great blog thanks.

      Author's profile photo Murugavel Singaravel
      Murugavel Singaravel

      Hi Arjit, Nice blog and very informative . I tried the steps as mentioned , can you please tell whether the from id we use in Job scheduler and the Mail.from parameter in the mail client should be the same . The job is not getting triggered for me. Please advise.

      Author's profile photo David Faßhauer
      David Faßhauer

      Hey Arijit,

       

      thanks for the nice blog! It was really helpful.

       

      BR, David