Maximo

Maximo

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

 View Only
  • 1.  Forcing the system data resource refresh

    Posted 03/22/22 07:51 AM
    Is there a way to force the refresh of resource defined as system resource

    ------------------------------
    Prasad Pandari
    ------------------------------



    #AssetandFacilitiesManagement
    #Maximo
    #MaximoAnywhere


  • 2.  RE: Forcing the system data resource refresh

    Posted 03/23/22 08:31 AM
    You can add refreshOnLogin="true" on the resource which will cause it to be refreshed when the user logs in automatically. For settings or small data sets that change frequently that could be advantageous over asking the user to refresh their data.

    ------------------------------
    Steven Shull
    ------------------------------



  • 3.  RE: Forcing the system data resource refresh

    Posted 03/24/22 09:32 AM
    Is there any other way to accomplish other than logout and login. 
    Thanks

    ------------------------------
    Prasad Pandari
    ------------------------------



  • 4.  RE: Forcing the system data resource refresh

    Posted 04/11/22 09:13 AM
    Hi Steven,

    Did refreshOnLogin="true" work for you. My experience is, it does not work for System data atleast. I will be interested to know, if it work for you and if you have done any thing extra other than setting the attribute in Resource.

    ------------------------------
    Siddhartha Upadhyaya
    Package Consultant - Maximo
    IBM India
    (11) 111-1111
    ------------------------------



  • 5.  RE: Forcing the system data resource refresh

    Posted 04/12/22 10:31 AM
    I've never tried to add additional resources but I know that the 5 out of the box get refreshed on login. It requires the isSystem="true" and refreshOnLogin="true" on the resources. If it doesn't work I can try and see if we force those to load another way but I believe that was all that was required.

    ------------------------------
    Steven Shull
    ------------------------------



  • 6.  RE: Forcing the system data resource refresh

    Posted 04/13/22 08:51 AM
    Thanks Steven for your response. Yes agree on the setting about isSystem="true" and refreshOnLogin="true", but our experience is that it is not working [We tested in 7.6.3.1]. We try to synch the Crew team members details [OS: OSLCAMCREWLABOR ], but it was not working. Then Support team says the refreshOnLogin flag is not supported at this point.

    ------------------------------
    Siddhartha Upadhyaya
    Package Consultant - Maximo
    IBM India
    ------------------------------



  • 7.  RE: Forcing the system data resource refresh

    Posted 03/25/22 06:51 PM
    Prasad,

    The design intent of System Data was that this is pretty static in nature and would rarely change.  As such the perceived need (on the designers' part) to refresh it is pretty infrequent.  An occasional log-out and log-in (say once a day for example) is thought to be sufficient to enable a system refresh on a frequency such that users should have pretty timely data refresh on system level data. Examples of System Level Resources are MyLabor, Domains (Synonym, ALN, Numeric), the WOSTATUS object, WPEDIT Settings, and the CrewLabor Object.  These typically are fairly static, and again if there is a need to change, a simple log-out and log-in and end of shift or beginning of shift should be a very light requirement for a user to accept.  Hope this helps.

    ------------------------------
    Bradley K. Downing , MBA
    Solutions Engineer
    IBM
    Bakersfield CA
    ------------------------------



  • 8.  RE: Forcing the system data resource refresh

    Posted 04/04/22 04:01 PM
    Hi Bradley,

    Thanks for the response. I understand that the logout and login will refresh the data. But user wants to avoid typing in16 digit password.
    To solve this I am assuming there should be some method in framework which product team might be using.
    I did some digging and thought method ModelService.allWithOslcWhereAndLocalQuery is something useful and added it in completionHandler to see what it does.
    ModelService.allWithOslcWhereAndLocalQuery('activeCrew',null,null,'getUserCrew', 100, false).then(function (activeCrewSet) {
        console.log('testing');
    }).otherwise(function(error) {
        console.log('error');
    });
    When I see contents of activeCrew, that is coming out of this call, its not changed.

    ------------------------------
    Prasad Pandari
    ------------------------------



  • 9.  RE: Forcing the system data resource refresh

    Posted 04/05/22 11:57 AM
    So it appears that your CREW resource is the one you are interested in getting refreshed? To the best of my knowledge the Crew Status domain and the Crew Status Type domain are the only "system" related resources to the Crew. So I think I need a better understanding of what it is you are really trying to do before I can advise you on any actions to take.  One thing to be sure is that the challenge you might be facing right now is on of "timing".  That is when you make a call on a resource and when it actually gets updated is important to understand.  The use of the "promise" (implicit in your ModelService.all call using the ".then") means the asynchronies response you are waiting upon may affect your data and user experience. This means you may want to choose another method to force the data refresh.  But having said all that: again.... what specifically are you trying to do?

    ------------------------------
    Bradley K. Downing , MBA
    Solutions Engineer
    IBM
    Bakersfield CA
    ------------------------------



  • 10.  RE: Forcing the system data resource refresh

    Posted 04/11/22 09:13 AM
    Hi Prasad / Bradely,
    May I request to check this JS: _SystemResourceCache. My understanding, all the System data in Anywhere is cached and the below code will not reload the data:
    ModelService.allWithOslcWhereAndLocalQuery('activeCrew',null,null,'getUserCrew', 100, false).then(function (activeCrewSet) {
        console.log('testing');
    }).otherwise(function(error) {
        console.log('error');
    });

    I believe you need to cached the data after getting it from Maximo., So add a line 
    SystemResourceCache.cacheSystemResource(...) and check.

    ----------------
    Siddhartha Upadhyaya
    Package Solution Consultant
    IBM
    India.
    ----------------

    ------------------------------
    Siddhartha Upadhyaya
    Package Consultant - Maximo
    IBM India
    (11) 111-1111
    ------------------------------