Quantcast
Channel: PTC Community : Unanswered Discussions - Windchill
Viewing all articles
Browse latest Browse all 3592

How to rewrite comments in AssignedActivity ?

$
0
0

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;

    }                               

}

 



Viewing all articles
Browse latest Browse all 3592

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>