Maximo

Maximo

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

 View Only
  • 1.  Difference between Java class attributes vs. attributes of object/table?

    Posted Wed December 01, 2021 10:07 PM
    Edited by System Admin Wed March 22, 2023 11:51 AM
    MAM 7.6.1.2:

    I'm trying to get familiar with the Java classes in the docs -- for the purpose of automation scripting, not Java development.

    Is there a difference between Java class attributes and the attributes of an object/table?
    [removed text that was confusing]

    Thanks.
    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: Difference between Java class attributes vs. attributes of object/table?

    Posted Thu December 02, 2021 09:09 AM
    Java Docs are generated based on the source code. It can't look at the underlying database and won't change unless the underlying source code changes and the Java Docs are rebuilt from the updated source code. For some of the Maximo objects, the developers went through the process of writing these comments in the source code to help describe what some of the out of the box attributes are used to do. You won't find it for all the out of the box attributes nor even all the objects since it has to be done manually.

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



  • 3.  RE: Difference between Java class attributes vs. attributes of object/table?

    Posted Thu December 02, 2021 09:54 AM
    Edited by System Admin Wed March 22, 2023 11:54 AM
    Thanks. I think my original question/example was confusing.
    It sounds like the attributes that are listed in the Java docs are just a description of some of the attributes from the object/table.

    The reason I asked was: in other systems/platforms, there can be multiple different concepts of attributes. For example, in ArcGIS geodatabases, there are table attributes (i.e. ASSET_ID), but there are also other kinds of attributes like the attributes of a spatial object datatype (i.e. ST_GEOMETRY.NumPts). But that doesn't have anything to do with Maximo/Java, it's just an example of different concepts of "attributes".

    So I had wondered if the Java class attributes might have been slightly different than table attributes. I'd wondered if Java attributes might have represented empty variables, or something like that, that might not literally be the table attribute data. But I think we can just disregard.


  • 4.  RE: Difference between Java class attributes vs. attributes of object/table?

    Posted Thu December 02, 2021 10:31 AM

    You'll see the public variables in the classes as "fields" in the Java Docs. So if you look at the WO class for example:

    https://bportaluri.com/wp-content/MaximoJavaDocs76/psdi/app/workorder/WO.html 

    Below the attributes you have the Field Summary which will show any public variables inside the class that you can access (like mbo.assetMoveFromChangeSttaus - ps, gotta love typos that last forever :)). 

    That being said, I can't think of a single scenario where I used a public variable and it's rare for them to be declared public. Most of them are declared as private so they aren't accessed and especially modified outside that class. You typically want code to interact with public methods instead of interacting with variables. In some cases, these methods might simply exist to return these private variables. For example, the function getAlreadyReportedSet() returns a private variable that is managed inside the class. But by forcing them to use the function to get the value, you can ensure they don't modify the variable directly and cause unexpected results. And in the future you could add additional logic to the method to do some action when the value is requested that wouldn't be possible if they were interacting with the variables directly. 



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