设置对象状态:
ReferenceFactory rf = new ReferenceFactory();
WTDocument doc = (WTDocument) rf.getReference("OR:" + WTDocument.class.getName() + ":" + "1706046").getObject();
LifeCycleHelper.service.setLifeCycleState((LifeCycleManaged) doc , State.toState("INWORK"));// 设置状态
升级请求添加及移除受影响对象:
WTHashSet oldSets = new WTHashSet();// 用来保存旧版本对象
oldSets.add(doc);
StandardMaturityService maturityService = new StandardMaturityService();
PromotionNotice pro = (PromotionNotice) rf
.getReference("OR:" + PromotionNotice.class.getName() + ":" + "1985285").getObject();
pro = maturityService.deletePromotionTargets(pro, oldSets);// 删除升级流程中旧版本对象
WTHashSet newSets = new WTHashSet();// 用来保存新版本对象
newSets.add(doc);
maturityService.savePromotionTargets(pro, newSets); 添加新版本对象到升级流程中