on 03-18-2008 9:22 AM
Hi,
I am working on ALERT.I have done all the configuration from the transaction ALRTCATDEF and ALERTINBOX as described in SDN.But I want to create an alert for a mapping problem.Please explain me how to triger the alert for a particular mapping logic .
Regards,
Somenath
Hi Somenath,
In this case u can trigger an alert from the UDF.What you can do is check for your mapping logic if the condition does not satistfy than u can trigger the alert.For trigerring alerts from UDF check the below link:
/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function
Thanks,
Bhargav.
Note:Award points if found useful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thanks for ur reply.UR ans are very helpful.Could you please send me some example udf with the logic to trigger the alert .
Regards,
Somenath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
package com.guarneri.xi.mapping.udf;
public class CustomMappingException extends RuntimeException {
public CustomMappingException() {
super();
}
public CustomMappingException(String message) {
super(message);
}
public CustomMappingException(Throwable cause) {
super(cause);
}
public CustomMappingException(String message, Throwable cause) {
super(message, cause);
}
}
package com.guarneri.xi.mapping.udf;
public class ExceptionThrower {
public static void fire(String message) throws CustomMappingException {
throw new CustomMappingException(message);
}
}
imports==> com.guarneri.xi.mapping.udf;
public void ThrowException(String[] theValue, String[] theMessage, ResultList result) {
if(theValue.length==0 || theValue[0].trim().length()==0 || theValue[0]=="$Error$")
ExceptionThrower.fire(theMessage[0]);
else
result.addValue(theValue[0]);
}
}
function myudf(String a,Container container)
{
int i=0;
try
{
i=Integer.parseInt(a);
catch(NumberFormatException e)
{
throw new NumberFormatException("Not a Number");
}
return i;
}
You can write the UDF which throws NumberFormatException that triggers the Alert message in your alert inbox.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.