当我们自己做了一个工作台后,就需要自己去更新BPM中流程的属性值。怎么更新呢
之前写DEMO的时候,写了个实例。保存以供后用
TaskFacadeServiceImpl tfs=new TaskFacadeServiceImpl(username,password);
ITaskQueryService taskQeryService=tfs.getWfSvcClient().getTaskQueryService();
ITaskService tasekService=tfs.getWfSvcClient().getTaskService();
IWorkflowContext ctx;
try {
ctx = tfs.authentication(username,password);
QueryContext qc = QueryContext.getQueryContext();
List<Task> lst = tfs.queryAssignedTaskList(ctx,qc);//查询出所有此用户的任务列表
Task task = null;
if (lst != null && lst.size() > 0) {
for(Task t1 :lst){
if(sqdzj.equals(t1.getSystemMessageAttributes().getTextAttribute1())){
task = t1;
}
}
}
Task newTask = tfs.queryTaskDetailByID(ctx, task.getSystemAttributes().getTaskId());//这个地方,也不是很明白,也许是重新得到一次吧
if(users!=null&&!users.equals("")){
newTask.getSystemMessageAttributes().setTextAttribute3(users);
}else{
newTask.getSystemMessageAttributes().setTextAttribute3("aaaaa");
}
if(jcjg!=null&&!jcjg.equals("")){
newTask.getSystemMessageAttributes().setTextAttribute4(jcjg);
}
if(xyjddm!=null&&!xyjddm.equals("")){
newTask.getSystemMessageAttributes().setTextAttribute10(xyjddm);
}
newTask.getSystemMessageAttributes().setTextAttribute5(zt);//更新属性
newTask.getSystemMessageAttributes().setTextAttribute6(sendUser);
newTask.getSystemMessageAttributes().setTextAttribute7(time);
Task task1= tasekService.updateTask(ctx, newTask);//更新属性值
Task task2 =tasekService.updateTaskOutcome(ctx, task1, outcome);//更新outcome
} catch (SysException e) {
System.out.println(e.getMessage());
}
、、、、、、、、、、、、、、、、、、、、、、、、以上是完整的代码、、、、、、、、、、、、