Maximo

Maximo

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

 View Only
  • 1.  Maximo Java Customization

    Posted Fri May 07, 2021 02:06 AM
    Hi all I am facing one strange issue in java 

    I am getting the set from mxserver after doing set where and reset I got count of set let's say 7 then I am traverssing using for loop 
    MboSetRemote assetSet = mx.getMboSet("ASSET", userInfo);
    assetSet.setWhere(my where clause)
    assetSet.reset()

    for (Int i= 0; (assetMbo= assetSet.getMbo(i))!= Null; i++)
    {
    if()
    {
    }
    else{
    }
    if()
    {
    }
    }

    But when loop traverse it works fine for first 3 records it is working fine as soon as 4 the record loop mbo is coming null.

    Is it because of memory issue ? Or in debugging where or how can we know that why mbo is coming null which shouldn't be null as we have 7 records in set

    #AssetandFacilitiesManagement
    #Maximo


  • 2.  RE: Maximo Java Customization

    Posted Mon May 10, 2021 09:03 AM
    Hi Sahil,

    This is unlikely to be a memory issue.
    It is much more likely to be something related to the records or what you are doing in the if/else blocks.

    Are you changing the changing the MBOSet in a significant way e.g. deleting MBOs or changing MBOs that you were expecting to work through?
    Are you triggering any other code (e.g. automation script/Java) that could be changing the records you would expect to see in the set?
    Could any of the records be child records and so be being affected by operations on an earlier MBO?

    Have you looked at the data in record 4 to see why it may not be listed?

    Have you looked at the SystemOut/SystemErr.logs to see if there are any error messages in there?
    There are unlikely to be any but it is always worth a check.

    best regards,
    Mark

    ------------------------------
    Mark Robbins
    Support Lead/Technical Design Authority / IBM Champion 2017 & 2018 & 2019 & 2020
    Vetasi Limited
    https://www.linkedin.com/pulse/maximo-support-advice-from-non-ibm-engineer-article-mark-robbins/
    ------------------------------



  • 3.  RE: Maximo Java Customization

    Posted Mon May 10, 2021 10:27 AM
    Edited by System Admin Wed March 22, 2023 11:45 AM
    Hi.

    Try traversing the MboSet with this for loop.

    for (MboRemote assetMbo = assetSet.moveFirst(); assetMbo != null; assetMbo = assetSet.moveNext())
    {
                ...
    }

    I hope that will be helpful.

    ------------------------------
    Daniel Torrescusa
    Piensa en nube, SL
    ------------------------------