06-12-2015 03:48 AM
//1. create a task
Task task = taskSrv.newTask();
task.setName("test execution");
task.setOwner(user1.getId());
task.setAssignee(user2.getId());
taskSrv.saveTask(task);
//2. set task variables
Map<String, Object> taskVariables = new HashMap<String, Object>();
taskVariables.put("finishedAmount", 0);
taskSrv.setVariables(task.getId(), taskVariables);
//3. complete this task with a new variable
Map<String, Object> finishVariables = new HashMap<String, Object>();
finishVariables.put("finishedAmount", 40);
taskSrv.complete(user2Tasks.get(0).getId(), finishVariables);
//4. get completed variable
List<HistoricVariableInstance> hisVarList = historyService.createHistoricVariableInstanceQuery().taskId(hisTaskList.get(0).getId()).list();
System.out.println(hisVarList); // here only get varibale finshedAmount = 0
List<HistoricDetail> hisDetailList = historySrv.createHistoricDetailQuery().variableUpdates().taskId(hisTaskList.get(0).getId()).list();
System.out.println(hisDetailList); // and I tried historicDetailQuery, there is no results.
06-12-2015 06:58 AM
06-12-2015 09:11 PM
06-16-2015 05:07 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.