Thanks Kier! I updated the code per your note and it works great. Just an FYI for anyone that might read this post, make sure the expression robot is placed after the task in the workflow where the variable is being set.
Here is the code that I used that works (specific to my use case of an atribute and variable both of type string with the internal name of "IFRQ_Number"):
wt.change2.WTChangeOrder2 thisNotice = (wt.change2.WTChangeOrder2) primaryBusinessObject;
com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(thisNotice,null,null,null);
obj.load("IFRQ_Number");
obj.set("IFRQ_Number", IFRQ_Number);
obj.apply();
wt.fc.PersistenceHelper.manager.modify(thisNotice);