I used to think that any code I put into a post action registered against item or revision creation would be the last thing to run after the creating the item or revision. But that is not true when NX is involved.
I discovered this by implementing a post-action on Item creation that set the object_name field after consulting an external system. Everything appeared fine when I tested it in the Teamcenter rich client. However I discovered that when I created an item in NX the name that my code had applied had been lost. Stepping through the code with the debugger verified that it was still behaving properly but apparently the value was changing after my post-action had exited. So, what had happened?
When attributes are mapped between Teamcenter and NX the mapping specifies whether Teamcenter, NX, or both systems are the
master of the attribute. In other words, which system can you use to edit the local attribute and have the change show up in the other system? Item.object_name in TC is hard-coded to be mapped to the NX property DB_PART_NAME and the master is both.
The Post Post-Action Action
It seems that NX’s local values for properties are mapped to Teamcenter after the item is created and the post-action is run. So whatever values NX has locally for the DB_PART_NAME (the item ID, by default) is applied to the Teamcenter item after the post-action is run.
I’ve also seen this same behavior with other mapped attributes where I have defined the mapping and not just the hard-wired default ones.
I checked with GTAC and apparently there isn’t any way to stop this except to create a custom user exit for NX that sets the property correctly. I guess this would be something that would run after the mapping that happens after the post-action.