Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
If the AssignedActivity is done and the comments has been write in DB,how could I rewrite it?
WTDocument doc_1 = null;
doc_1 = cc.getDoc(docNumber,false); //get WTDocument handle
wt.fc.QueryResult QR = wt.workflow.work.WorkflowHelper.service.getWorkItems(doc_1);
while(QR.hasMoreElements())
{
wt.workflow.work.WorkItem workitem = (wt.workflow.work.WorkItem)QR.nextElement();
wt.workflow.engine.WfActivity wfactivity = (wt.workflow.engine.WfActivity)workitem.getSource().getObject();
if(wfactivity.getName().equals(TaskaName))
{
wt.workflow.work.WfAssignedActivity ac=(wt.workflow.work.WfAssignedActivity)workitem.getSource().getObject();
wt.workflow.engine.ProcessData processData = ac.getContext();
processData.setTaskComments("new comments"); //set new comments
//----------------I try to update AssignedActivity and WTDocument, but it has no effect
//PersistenceServerHelper.manager.update(ac);
//PersistenceServerHelper.manager.update(doc_1);
out.print("done~");
break;
}
}