cancel
Showing results for 
Search instead for 
Did you mean: 

Send Alert emails using UDF

Former Member
0 Kudos

Hi All,

Can we send alert emails using UDF?

Regards,

XIer

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hey

sure we can .

/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function

Thanx

Aamir

Message was edited by:

Ahmad Aamir

justin_santhanam
Active Contributor
0 Kudos

Ahmad,

Can u tell how. I suggested him that we can raise runtime exception so that we can trigger the alert for this interface, am I right?

Best regards,

raj.

Former Member
0 Kudos

Hey Raj

i just updated my reply with the blog

/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function

Thanx

Ahmad aamir

Message was edited by:

Ahmad Aamir

justin_santhanam
Active Contributor
0 Kudos

Ahamad,

Thanks buddy. This is the way to call the FM through creating receiver RFC Adapter channel. Tell ur views on my suggestion in the above reply, will it work? I can do the same by creating Alert category for this paritcular interface right? Please correct me if i'm wrong.

Best regards,

raj.

Former Member
0 Kudos

Hey Raj

yes,as long as you can trigger an exception from the UDF,you can simply configure alerts in ALRTCATDEF and it should trigger the alert.

but i m not sure how you are gonna trigger the exception from UDF.

is it this?

/people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

Thanx

Ahmad aamir

justin_santhanam
Active Contributor
0 Kudos

Ahmad,

U can trigger the exception explicitly by using

<b>throw new RuntimeException("This occurred to trigger an alert");</b>

Best regards,

raj.

Former Member
0 Kudos

Hey Raj

yeah this should work.

Thanx

Ahmad aamir

Former Member
0 Kudos

Ahmed now I want to raise exception if the two fields are not equal? How do I go about it using UDF?

Regards,

XIer

Former Member
0 Kudos

Hey

well i didnt try using UDF but a lot of times i use a way around which works for me.

i raise exception using conditional receiver determination:)

what i do is,i give condition in the conditional receiver determination that if <tag1>=<tag2> then goto BS_DUMMY(you can give any dummy business system name,just make sure u dont define this in SLD),as soon as system will see this line,it will raise an exception of "Receiver not found" in sxmb_moni and coz u have defined alert category ALRTCATDEF,an alert will be triggered.

this saves me from writing any UDF code and also i dont need to import/export this UDF code from Dev to QA and Prd.

its one of my weird techniques but i use it coz it does the job:)

Thanx

Ahmad aamir

Former Member
0 Kudos

Hi Ahmed,

Thats a clever way indeed. But can I compare two fields from the same interface, also can I compare multiple fields in condition receiver determination step.

Regards,

XIer

Former Member
0 Kudos

Hey

yeah,you can have as many conditions as you want in conditional receiver determination,see the bottom line for alerts is that they are only triggered when some error occurs,now its upto you to trigger the alert,you can trigger that from mesage mapping(by writin UDF for alerts) or you can intentionally give some wrong conditions in conditional receiver/interface determination.

all depends upon what you wanna do,bottom line is trigger the alert:)

Thanx

Aamir