Query query1 = arg0.createQuery(hql1);
query1.setInteger("state", ITaskInstance.CANCELED);
query1.setDate("endTime", now);
query1.setBoolean("canBewithdrawn", Boolean.FALSE);
query1.setString("processInstanceId", processInstance.getId());
query1.executeUpdate();
//更新所有工作项的状态为canceled
String hql2 = "Update org.fireflow.engine.impl.WorkItem as m set m.state=:state,m.endTime=:endTime Where m.taskInstance in (From org.fireflow.engine.impl.TaskInstance n Where n.processInstanceId=:processInstanceId) And (m.state=0 Or m.state=1)";
Query query2 = arg0.createQuery(hql2);
query2.setInteger("state", IWorkItem.CANCELED);