Maximo

Maximo

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

 View Only
  • 1.  Complex resource attribute not showning in Maximo Anywhere

    Posted Fri May 07, 2021 02:17 AM
    <attribute describedByProperty="spi:assetabc{spi:asset{oslc:shortTitle}}" id="inspectionmeterResource_spi_assetdesc" name="assetnumdesc"  />​

    Hi All,

    I've created an extra table that I'm storing meters and their readings, linked to the work order.  It's populated with the meter name, asset number, siteid and columns to store the readings, however, that is not the problem.  I have added the child object structure to the OSLCWODETAIL and that works fine, however, in order to do meter readings I need additional information from the asset, Assetmeter and Meter objects as well.  So from the asset meter OSLC object I can access both the asset and meter objects, just not return any info when it's constructed as third-level detail i.e work order --> tr meters --> asset meter --> asset or meter.

    So I've added a resource mapping (see screenshot), and using the resource reference (see code snippet) wanted to display things like the asset number, asset description, meter name, meter description, etc..., but to no good.  I can use an OSLC query follow-through from the work order to the asset meter to the asset, so I know that should not be the source of the issue. See the screenshot from MA

    I have reviewed other code which comes with MA and that works, see the following code:
    <attribute describedByProperty="spi:locoper{spi:failureCode{oslc:shortTitle}}" id="additionallocations_failurecode_spilocoperspifailureCodeoslcshortTitle" name="failurecode"/>​
    <attribute describedByProperty="spi:asset{oslc:shortTitle}" id="workOrder_asset_spiassetoslcshortTitle" index="true" method="assetChanged" name="asset" referenceResource="additionalasset"/>


    This is getting very frustrating, any suggestions?  BTW (Maybe Bradley) can explain the use of referenceResource.  I see it, I know the resource, but it alludes me to what it does.

    In essence, my code should work as I can do an OSLC query, though there is a back of the head talking to me saying "it's a known behaviour".

    Any thoughts?





    ------------------------------
    ===============================
    Craig Kokay,
    Lead Senior Maximo/IoT Consultant
    ISW
    Sydney, NSW, Australia
    Ph: 0411-682-040
    =================================
    #IBMChampion2021
    ------------------------------



    #Maximo
    #AssetandFacilitiesManagement
    #MaximoAnywhere


  • 2.  RE: Complex resource attribute not showning in Maximo Anywhere

    Posted Mon May 10, 2021 10:28 AM
    Hiya Craig!!

    I trust all is well with you.  At first pass on this I am thinking "you can't do a grandparent relationship call."  That is, from the workorder it is not possible to get the child of the child, specifically the meter info from the asset on the workorder in your case.  Then I see the locoper reference to Failure code you site.  Ah! yes, that is a difference though in that you are on the resource locoper and you are simply getting the failure code as defined on the operating location.  It is only two levels not three.

    In your modified workOrder details resource on the mapping side you are including a reference to the ASSETMETER object (which is fine from the OSLC side!)  However in the Anywhere resource framework you cannot have a grandchild reference directly on the top level. The JSON resources do not support the grandchild reference structure.  So you need the referenceResource attribute in the XML to link the grandchild.  Since the AssetMeter belongs to the Asset and you reference the Asset on your custom object then you need the additonalAsset resource to then bring in the Asset information.  

    I am curious however why the current architecture is insufficient for you.  The Asset and the Meterreadings objects and their resources are all in the WorkExecution app already, are you storing something else on your custom object? Also the custom object you are trying to link it directly to the workorder byut it appears it really belongs to the Asset.  What is the relationship to the workorder for the TRJOBPLANMETERS object? Are you storing many meter readings for each asset on every workorder?  How does that work when you have multiple assets on the workorder (i.e. multiassetlocci)?

    ------------------------------
    Bradley K. Downing , MBA
    IBM Certified Adv. Deployment Prof. Maximo v7.6.1
    IBM
    ------------------------------