The order you provide attributes doesn't matter in the integration framework. The reason there is a sequence is we define a unique index based on the order of the order of the columns. And you are correct that it will use all of the fields to make a match. For example, you can have asset 1001 in site BEDFORD & NASHUA. We use the ASSETNUM & SITEID combination to figure out which of the two you are updating.
Regarding non-persistent attributes being flagged as part of the primary key columns, you won't see that on persistent objects because of the index piece I mentioned above. We can't say that a field help makes the record unique if that field doesn't exist in the table. You will see this occasionally on non-persistent objects like ISSUECURRENTITEM but non-persistent objects you won't typically interact with in MIF. There are some exceptions (like MXRECEIPT) that are going to have their own unique way of matching up records (providing either the sendersysid & externalrefid or setting the receiptref field to the MATRECTRANSID/SERVRECTRANSID). But generally speaking, these non-persistent objects are going to be used by the UI only.
Original Message:
Sent: Sun April 16, 2023 08:06 AM
From: Rana Ahmed Naazir
Subject: How does Maximo determines that it should create a new record or update an existing record?
Thanks for the reply.
1. Does the primary key column sequence number matter?
I mean what does 1 or 2 mean here. I assume it will match both regardless of the number.
e.g. SITEID is 1 and ASSETNUM is 2 for ASSET object
2. There are some attributes which are required and part of primarykey but are non-persistent. How might they be used
SELECT OBJECTNAME, ATTRIBUTENAME , PRIMARYKEYCOLSEQ, REQUIRED, PERSISTENT FROM MAXATTRIBUTE m WHERE PERSISTENT = 0 AND required =1 and PRIMARYKEYCOLSEQ IS NOT NULL ORDER BY OBJECTNAME ASC,PRIMARYKEYCOLSEQ asc;
------------------------------
Rana Ahmed Naazir
Original Message:
Sent: Mon March 13, 2023 08:17 AM
From: Steven Shull
Subject: How does Maximo determines that it should create a new record or update an existing record?
Generally speaking, Maximo will utilize the primary key column sequence on the object to try and match the record. You can see the primary key column sequence in Database Configuration by opening an object like ASSET and sorting by the primary column field. For ASSET, you would provide the ASSETNUM & SITEID for it to match. On PERSON you just need to provide the PERSONID.
There is support on the object structure to specify an Alternate Key for the object. This allows the developer to pick an index on the object to use for matching purposes instead of the primary key column. This is useful when the sending system doesn't know the identifier but has its own way to provide a unique match.
------------------------------
Steven Shull
Original Message:
Sent: Fri March 10, 2023 05:48 AM
From: Rana Ahmed Naazir
Subject: How does Maximo determines that it should create a new record or update an existing record?
Hi,
When we send a packet to maximo e.g. using MXLoader with action type of Sync-AddChange
or another example, I send a packet with this payload
<max:SyncMXSIMPLEPERSON xmlns:max="http://www.ibm.com/maximo"> <max:MXSIMPLEPERSONSet> <PERSON> <PERSONID>TEST1</PERSONID> <FIRSTNAME>FFF</FIRSTNAME> <LASTNAME>LLL</LASTNAME> </PERSON> </max:MXSIMPLEPERSONSet></max:SyncMXSIMPLEPERSON>
e.g. in above packet it will create a new record if TEST1
does not exist but if it exists then it will update the LASTNAME
only.
Can any one point to classes in integration framework (or somewhere else) that does this functionality?
I want to understand the architecture.
When a packet is received maximo will determine if it needs to perform an update or add a new record
------------------------------
Rana Ahmed Naazir
------------------------------
#Maximo
#AssetandFacilitiesManagement