techie_blog
Newbie
Karma: 1
Posts: 7
|
 |
« on: July 30, 2010, 07:46:32 pm » |
|
Hello friends,
I am customizing an inbound User Exit Class for Person Interface. I have defined a new user field under Integration Object -> User Field (tab) called "EMAILSENT".
When the inbound Person XML File is processed for the first time, it does not have the tag "EMAILSENT". The inbound XML File is as follows:
<MXPERSON> <PERSON> <PERSONID>RX80821</PERSONID> <STATUS> INACTIVE </STATUS> </PERSON> </MXPERSON>
My User exit class is as follows:
public class PersonExit extends UserExit { private static final MXLogger log = MXLoggerFactory.getLogger("maximo"); public PersonExit() throws MXException, RemoteException { log.error("Into constructor of PersonExit"); }
public StructureData setUserValueIn(StructureData irData, StructureData erData) throws MXException, RemoteException { log.error("Into userexit class PersonExit.java"); String emailSent = erData.getCurrentData("EMAILSENT"); log.error("EmailSent:" + emailSent); if (emailSent == null || emailSent.equals(null)) { log.error("Into if loop of email sent is null"); String setEmailSentTo0 = "0"; erData.setCurrentData("EMAILSENT",setEmailSentTo0); } else { log.error("Into if loop of email sent is not null"); String newEmailSentValue = (Integer.parseInt(emailSent) + 1) + ""; erData.setCurrentData("EMAILSENT",newEmailSentValue); log.error("NewEmailSentValue:" + newEmailSentValue); }
return super.setUserValueIn(irData,erData); }
}
First time, when the Inbound XML File comes through the User Exit class, it will have a NULL value in the EMAILSENT (as this tag is not present in the XML). So I expect it to enter the if loop and set the EMAILSENT value to 0 and add the EMAILSENT tag in the XML File. Most of the times, the person XML File fails to get processed successfully, so that it gets into the error folder and will be reprocessed again. So I would like to count the number of times, the error XML File is reprocessed until it is rectified. When the XML File comes to the User exit class next time, it should already have a value of 0, so it should get into the else loop and should be incremented. But I see that the second time the XML File comes to the UserExit class, the EMAILSENT value is again NULL. It does not have the value of 0 that was set before.
Not sure where the flaw is. Appreciate your help!!
|