How not update EPMDocument attributes. Need to include as-stored baseline
So my team wrote a little utility to update some attributes on objects. Worked great but we are seeing out error and need to make a fix for drawings and assemblies. This is how we were checking out the objects:
//Checkout document
checkedOutDoc = (EPMDocument)WorkInProgressHelper.service.checkout(document, WorkInProgressHelper.service.getCheckoutFolder(), "").getWorkingCopy();
Everything as fine, object was iterated and the attribute were updated. Fast forward a few weeks and a user reported seeing the following.

This was odd since I remember kicking off a scheduled publishing job on these items myself and I am sure I selected to use the as-stored baseline. I attempted to republish this item again but in reading the WVS logs, I can see that it reports there is no as-stored baseline so uses latest as the alternative. Rut Roh Shaggy.
So cautionary tale. If anyone has the right sequence to update an object WITH the as-stored baseline and then check it in properly (bonus to trigger republishing), let me know. I will post what I find if I beat you to it.
PS-As of now, I know there should be a way to turn off the warning on out of date representations. Not sure if that is something I want to do. If I wanted to fix manually, it would be to download the previous iteration as-stored, update the drawing object only, check out then check in from a workspace. Very tedious.

