It has been a while since I set this up and I had help. It is my understanding that this needs to be in the properties to show on the task page and carry forward. We have the attributes in the CN workflow. We have also have the attributes in the Change Task workflow since that is where the users actually do their tasks. In the Change Task the attributes have different names. Since we need the attributes in the email or to route the email, we pass the attributes back and forth via the Complete Transitions of the different tasks depending on what the user is responsible for or can change. That way the CN is always up to date with the task once a task is completed.
The code for Boolean would look like this:
if (BooleanVariable==true) result="True";
else result="False";
The code is different to pass the variable from the task to the notice:
com.ptc.core.lwc.server.LWCNormalizedObject obj=new com.ptc.core.lwc.server.LWCNormalizedObject(parentChangeOrder,null,null, new com.ptc.core.meta.common.UpdateOperationIdentifier());
obj.load("CNCODE");
obj.set("CNCODE", CT_CNCODE);
obj.apply();
wt.fc.PersistenceHelper.manager.modify(parentChangeOrder);