Maximo Wire - The IBM Maximo Help & Discussion Forum
September 04, 2010, 11:29:36 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to Maximo Wire, the IBM Maximo help forum. Feel free to register and ask any Maximo related questions you like.
 
  Home Help Search Login Register  
*
Pages: [1]   Go Down
  Print  
Author Topic: Inbound User Exit customization  (Read 151 times)
0 Members and 1 Guest are viewing this topic.
techie_blog
Newbie
*

Karma: 1
Posts: 7


View Profile
« on: July 30, 2010, 08: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!!

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Recent

TinyPortal v1.0 beta 4 © Bloc
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!