Maximo

 View Only
  • 1.  Maximo integration object structure with parent and child WORKORDER objects

    Posted 4 days ago
    I am trying to create REST API calls on work orders, and I would like to have the parent and child work orders in the same message. I know I can use the WOACTIVITY object (view) to get tasks to a work order, but I'm having problems creating an object structure with the WORKORDER as the primary object and then as a child object. The WORKORDER object has a relationship available named "CHILDNOTASK" that seems ideal for this case.

    However, when I add the WORKORDER object a second time to the object structure, the Object Structures application gives me the following error:

    BMXAA1236E - Only one instance of a MBO set can be specified in the MBO location path.


    What options do I have to get this to work?

    -Theo Pozzy



  • 2.  RE: Maximo integration object structure with parent and child WORKORDER objects

    Posted 3 days ago

    Hi Theo,

    Depends on your requirement I think you don't need to have this done in object structure definition for GET calls. Maybe, it will be enough if you use "rel" notation "rel.<relation name>" in your case rel.childnotask in oslc.select section.

    Please observed that in this example I used out of the box MXAPIWO object.

    {{MASURL}}/maxrest/api/os/mxapiwo?oslc.where=wonum="1118"&oslc.select=wonum,description,siteid,orgid,rel.childnotask{wonum,description,parent}&lean=1

    Sample json response:
    {
        "member": [
            {
                "_rowstamp": "11321907",
                "worklog_collectionref": "http://localhost/maxrest/api/os/mxapiwo/_QkVERk9SRC8xMTE4/modifyworklog",
                "description": "Secure Room for Required Number Attendees",
                "siteid": "BEDFORD",
                "href": "http://localhost/maxrest/api/os/mxapiwo/_QkVERk9SRC8xMTE4",
                "childnotask": [
                    {
                        "parent": "1118",
                        "description": "Child WO 1",
                        "wonum": "1114"
                    },
                    {
                        "parent": "1118",
                        "description": "Child WO 2",
                        "wonum": "1285"
                    }
                ],
                "orgid": "EAGLENA",
                "wonum": "1118"
            }
        ],
        "href": "http://localhost/maxrest/api/os/mxapiwo",
        "responseInfo": {
            "href": "http://localhost/maxrest/api/os/mxapiwo?oslc.where=wonum=%221118%22&oslc.select=wonum,description,siteid,orgid,rel.childnotask{wonum,description,parent}&lean=1"
        }
    }



    ------------------------------
    Bartosz Marchewka
    IBM Maximo Consultant
    AFRY
    ------------------------------



  • 3.  RE: Maximo integration object structure with parent and child WORKORDER objects

    Posted 2 days ago

    Thank you for the suggestion. However, I am trying to create work orders with a POST operation. Therefore, I need to have the child work order be a JSON object inside the parent work order object.



    ------------------------------
    Theo Pozzy
    ------------------------------



  • 4.  RE: Maximo integration object structure with parent and child WORKORDER objects

    Posted 2 days ago

    Theo,

    The way MBOs work, you will need to create the parent first.  Maximo will not allow you to reference in a single pass an object which has not yet completed creation.  That is what you will do when you try to create children to a parent that you have not finished creating.  Same thing happens with Assets, Locations, nested Job plans etc.  Any parent-child MBO relationship requires the parent to be created first when the parent object is of the same object structure. Another thing that is particularly true for workorders is not only WONUM referencing but also WOGROUP.  To be able to populate the children records with a WONUM in a REST POST call for an object that does not yet exist would truly be magic.  ;)



    ------------------------------
    Bradley K. Downing , MBA
    Senior Solution Architect
    IBM
    Bakersfield
    ------------------------------