MxLoader

 View Only
  • 1.  Object ID return for REST API

    Posted 01-08-2025 13:20

    Hello everyone,

    Recently my company switched to MAS8 and we have changed our standard interactions from Service: OS to Service: REST with API key. Previously used files to create assets, route, and workorders are working but no longer return Object IDs. It is mentioned in the user guide that object ID are not supported on rest return but the change log has the following entry on 8.4.1 (Object IDs can be returned specifying them in square brakets '[]'). I noticed that previous version of Mxloader, the [] was blocked with an error message on the rest calls whereas the new version allow it. The object id (in this case, route) is returned in the Trace logging file but doesn't appear in Excel after processing (but the result does). 

    2025-01-07 14:51:44 [DEBUG] Parsing JSON: 
    2025-01-07 14:51:44 [TRACE]   _responsedata
    2025-01-07 14:51:44 [TRACE]     route
    2025-01-07 14:51:44 [TRACE]   _responsemeta
    2025-01-07 14:51:44 [TRACE]     status
    2025-01-07 14:51:44 [TRACE]     Location
    2025-01-07 14:51:44 [TRACE]     Content-Type
    2025-01-07 14:51:44 [DEBUG] Parsing JSON: 
    2025-01-07 14:51:44 [TRACE]   _responsedata
    2025-01-07 14:51:44 [TRACE]     route
    2025-01-07 14:51:44 [TRACE]   _responsemeta
    2025-01-07 14:51:44 [TRACE]     status
    2025-01-07 14:51:44 [TRACE]     Location
    2025-01-07 14:51:44 [TRACE]     Content-Type
    2025-01-07 14:51:44 [TRACE] Parsed response

      {
    ,

        {
          "ROUTE": "THEKEYOFTHEROUTE"
        },

        {
          "STATUS": "201"
        }
      }
    ]

    So I am trying to figure out if it is a bug based on the new changelogs or is still not yet supported? 

    Or if it is working for others? 

    And if it isn't going to be supported in the near future if there is opportunities for creating a fork? Rather than just writing a separate in-house REST handler.



    ------------------------------
    James Simmonds
    ------------------------------


  • 2.  RE: Object ID return for REST API

    Posted 01-10-2025 02:55
    Edited by Piotr Ozaist 01-10-2025 02:55

    Hi James,

    It's hard to me to answer if it's included in release plan for MxLoader future versions to fix this or add this as a feature - probably it's a question to Bruno directly :)

    What I can answer is a short description of workaround I've applied when I needed to load a massive amount of work orders to Maximo and later to apply some operations like status changes, etc - where I needed reference to created WONUMs. 
    Maybe workaround is obvious - let's see :)

    It's all about finding a field in Maximo, which you can temporarily fill with some data.
    For this purpose I've used ENVIRONMENT field which was empty in my case, but obviously any other field can be used (even added by quick DDL script like "ALTER TABLE ADD CUSTOMCOLUMN...").

    Later, in my first loading with MxLoader I've - beside of real WO data - loaded sequence 1,2,3,... to this column.

    When it has been loaded, on next MxLoader tab, I've queried Maximo for WO data with Query defined as ENVIRONMENT="*" which gave me the list of all WOs I've loaded moment ago, with whatever attributes I wanted (including WONUMs of course!).

    That data can be later used to load whatever we want!

    In the end, simple script to clean after our loading can be executed - and that's all!

    UPDATE WORKORDER SET ENVIRONMENT = NULL
    WHERE ENVIRONMENT IS NOT NULL

    As said - maybe that's something obvious, but at least it let us to walk around problem with not returned ObjectIDs!
    Hope it will help somehow!

    Regards!



    ------------------------------
    Piotr Ozaist
    Afry
    ------------------------------



  • 3.  RE: Object ID return for REST API

    Posted 01-13-2025 14:35

    Thank you for confirming Piotr, it is greatly appreciated. I like the idea of staying within the tool and using additional unused fields if available for a two-step approach rather than building or teaching a new process.



    ------------------------------
    James Simmonds
    ATCO
    ------------------------------



  • 4.  RE: Object ID return for REST API

    Posted 10-20-2025 08:30
    Hi James,
    Like you, I was too affected by the loss of the "square brackets functionality" and I was hoping for a fix untill I had an idea.
    After analysing the request and response payloads being sent between Maximo and the MxLoader, I discovered that the malfunction is probably caused by a misinterpretation of the HTTP status of the response.
    in summary:
    When updating an object (Maximo Mbo), the "square brackets" work as expected, and the status property in the _responsemeta object of the payload in the response message (from Maximo to Mxloader)  is 200 (OK).
    However, when creating an object (Maximo Mbo), the "square brackets" do not work, and in the status property  in the _responsemeta object of the payload is 201 (Created).
    Example of a complete response payload:
    [{"_responsedata":{"description":"TEST","classstructureuid":1587},"_responsemeta":{"status":"200","Content-Type":"application\/json"}}]
    So I configured a reverse proxy to modify the response payload before it reaches the MxLoader, thereby changing the status from 201 to 200.
    This solved the issue, but it's still a workaround. Piotr suggestion is also a valid alternative.
    I just thought it was worth sharing.


    ------------------------------
    Yuri Vedovato
    Tempestive
    ------------------------------



  • 5.  RE: Object ID return for REST API

    Posted 10-22-2025 03:14
    Edited by Yuri Vedovato 10-22-2025 04:52

    For anyone who is interested, here is a link to my article, containing further details about the workaround I described.

    A workaround to allow MxLoader to return Object IDs using square brackets '[]' in MAS



    ------------------------------
    Yuri Vedovato
    Tempestive
    ------------------------------



  • 6.  RE: Object ID return for REST API

    Posted 10-22-2025 04:47
    Edited by Bruno Portaluri 10-22-2025 05:04

    Thank you Yuri for troubleshooting the root cause of the issue.

    I have released MxLoader 8.4.3 that solves this issue.

    Let me know if it's ok now.



    ------------------------------
    Regards
    Bruno Portaluri (MaximoDev)
    ------------------------------