Maximo Open Forum

 View Only

 Object Structure Inbound Processing for WPLabor Ignores TASKID

  • Integrations
  • Work Management
Jared Schrag's profile image
Jared Schrag posted 09-03-2024 12:15

I've got an Object Structure with WORKORDER as the top/main object and WPLABOR as the child Object (hierarchy is WORKORDER/WPLABOR) using the WPLABOR relationship (wonum=:wonum and siteid=:siteid). The inbound processing class is set to psdi.iface.app.wo.MaxWOProcess.

I am trying to integrate inbound using this Object Structure in order to add new WPLABOR records to an existing Parent Work Order that has an existing Task Work Order. I am wanting, in the inbound payload, to have the SITEID, WONUM of the Parent WO specified (just to identify the unchanged Parent WO) and on the WPLABOR part of the payload, identify the TASKID for the Task WO. The issue is that when this inbound payload processes, it adds the WPLABOR record, associating it to the Parent WO, not the Task WO. I'm expecting to be able to specify multiple WPLABOR records in a single payload, all adding new WPLABOR, perhaps some will have no TASKID value (in which case the WPLABOR is associated with the Parent WO (i.e. WPLABOR.WONUM is set to the Parent WO WONUM)), and others in the inbound payload will have a valid TASKID vaue (in which case the WPLABOR is associated with the Task WO (i.e. WPLABOR.WONUM is set to the Task WO WONUM)).

I've also tried implementing an inbound Object Structure processing Automation Script, imlementing the beforeMboData() function, but when it tries to set the context Mbo attribute value for WONUM ( ctx.getMbo().setValue("WONUM", taskWONum, MboConstants.DELAYVALIDATION) ), it gets an error indicating that it cannot be updated because it is readonly or part of a primary key.

I guess I was expecting to use the inbound  integraiton much like the front end in Work Order Tracking, Plans tab. In the front end, you can add multiple WPLABOR records to the same MboSet on screen, and they could have Task ID empty (associate WPLABOR to Parent WO) or it could be populated with a valid Task ID (associate WPLABOR to Task WO).

Jared Schrag's profile image
Jared Schrag

I did backout my Object Structure inbound processing automation script and changed the Relationship used in the Object Structure to SHOWPLANLABOR (the same Relationship used in the Work Order Tracking Plans tab) and tried again - and this seems to work as I had originally expected! Not sure what to make of it. I was able to process with the TASKID populated and unpopulated and the new WPLABOR record landed associated with the Task WO and Parent WO respectively (as originally expected). In both cases, the WORKORDER record in the object structure was for the existing Parent WO. It seems that the Relationship used in the Object Structure made all the difference.