Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  MIF WO STATUSDATE update problem

    Posted 01/18/21 04:15 PM
    Edited by System Admin 03/22/23 11:49 AM
    Hello, 
    I have the same problem with this link.  Cannot set user-defined date for the Work Order's status date through MIF When I create a WO with MIF, the STATUSDATE becomes the sysdate. 

    I extend StatefulMicSetIn class and override changeStatus method.

    How can I set the value I sent from xml (STATUSDATE) ? <STATUSDATE>2008-10-08T17:13:09</STATUSDATE>

    @Override

    public void changeStatus(MboRemote setMbo, String stat, String memo) throws MXException, RemoteException {

    ((StatefulMbo) setMbo).changeStatus(stat, struc.getCurrentDataAsDate("STATUSDATE"), memo);

    }


    Thank you





    ------------------------------
    Alan Egman
    ------------------------------
    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: MIF WO STATUSDATE update problem

    Posted 01/19/21 08:54 AM
    If you're running 7.6.0.X or 7.6.1.X of Maximo I would suggest using an automation script instead of extending the class. Documentation on it can be found here: Change status or status date by using the changeStatus(ctx) function (ibm.com) though that won't cover your exact scenario and is JavaScript. We personally prefer using python style scripting so it'd look something like this:

    from psdi.server import MXServer
    def changeStatus(ctx):
        mbo=ctx.getMbo()
        struc=ctx.getData()
        statusDate=struc.getCurrentDataAsDate("STATUSDATE")
        if not statusDate:
            statusDate=MXServer.getMXServer().getDate()
        mbo.changeStatus(struc.getCurrentData("STATUS"),statusDate,struc.getCurrentData("NP_STATUSMEMO"),mbo.MboConstants.NOACCESSCHECK)​



    ------------------------------
    Steven Shull
    Director of Development
    Projetech Inc
    Cincinnati OH
    ------------------------------



  • 3.  RE: MIF WO STATUSDATE update problem

    Posted 01/20/21 03:30 AM
    Hello Steven, 
    Thank you for your answer. I thought about it.  But I don't know if it will be useful for us. I created a custom java class, but it's not executing.  I am trying to find the problem. 



    ------------------------------
    Alan Egman
    London
    07555344655
    ------------------------------



  • 4.  RE: MIF WO STATUSDATE update problem

    Posted 01/21/21 06:30 AM

    I am also having the same problem with INCIDENT status date  TKSTATUS.CHANGEDATE. I am sending <CHANGEDATE>2020-06-15T10:59:08</CHANGEDATE> but set SYSDATE.

    How can i solve this?



    ------------------------------
    Alan Egman
    London
    07555344655
    ------------------------------