assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no execution id", historicTaskInstance.getExecutionId()); assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no process definition id", historicTaskInstance.getProcessDefinitionId()); assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no task definition key", historicTaskInstance.getTaskDefinitionKey());
public Result deleteCurrentTaskInstance(String taskId, HistoricTaskInstance taskInstance) { //删除正在执行的任务 //删除HistoricTaskInstance String sql_task = "delete from " + managementService.getTableName(HistoricTaskInstance.class) + " where " + "ID_='" + taskId + "' or ID_='" + taskInstance.getId() + "'"; this.executeSql(sql_task); //删除HistoricActivityInstance String sql_activity = "delete from " + managementService.getTableName(HistoricActivityInstance.class) + " where " + "TASK_ID_='" + taskId + "' or TASK_ID_='" + taskInstance.getId() + "'"; this.executeSql(sql_activity); //获取当前的任务,保存签收人 Task task = taskService.createTaskQuery().executionId(taskInstance.getExecutionId()).singleResult(); task.setAssignee(taskInstance.getAssignee()); task.setOwner(taskInstance.getOwner()); taskService.saveTask(task); //解决HistoricActivityInstance的Assignee为空的现象 if (!StrUtil.isEmpty(taskInstance.getAssignee())) { String sql_update = "update " + managementService.getTableName(HistoricActivityInstance.class) + " set " + "ASSIGNEE_='" + taskInstance.getAssignee() + "' where TASK_ID_='" + task.getId() + "'"; this.executeSql(sql_update); } String sql_update_execution = "update " + managementService.getTableName(Execution.class) + " set " + "ACT_ID_='" + taskInstance.getTaskDefinitionKey() + "' where ID_='" + taskInstance.getExecutionId() + "'"; this.executeSql(sql_update_execution); return new Result(true); }
private String getId() { if(task != null) { return task.getId(); } else { return historicTask.getExecutionId(); } }
private String getId() { if(task != null) { return task.getId(); } else { return historicTask.getExecutionId(); } }
public WorkflowPath getWorkflowPath(HistoricTaskInstance historicTaskInstance) { WorkflowPath path = null; // Check to see if the instance is still running Execution execution = activitiUtil.getExecution(historicTaskInstance.getExecutionId()); if(execution != null) { // Process execution still running path = convert(execution); } else { // Process execution is historic path = buildCompletedPath(historicTaskInstance.getExecutionId(), historicTaskInstance.getProcessInstanceId()); } return path; }
public WorkflowPath getWorkflowPath(HistoricTaskInstance historicTaskInstance) { WorkflowPath path = null; // Check to see if the instance is still running Execution execution = activitiUtil.getExecution(historicTaskInstance.getExecutionId()); if(execution != null) { // Process execution still running path = convert(execution); } else { // Process execution is historic path = buildCompletedPath(historicTaskInstance.getExecutionId(), historicTaskInstance.getProcessInstanceId()); } return path; }
private MutableBpmTask collectHistoryActivity(HistoricTaskInstance task, ProcessInstance pi, UserData user) { MutableBpmTask t = new MutableBpmTask(); t.setProcessInstance(pi); t.setAssignee(user.getLogin()); t.setOwner(user); t.setTaskName(task.getName()); t.setInternalTaskId(null); t.setExecutionId(task.getExecutionId()); t.setCreateDate(task.getStartTime()); t.setFinishDate(task.getEndTime()); t.setFinished(task.getEndTime() != null); return t; }
result.setDurationInMillis(taskInstance.getDurationInMillis()); result.setEndTime(taskInstance.getEndTime()); result.setExecutionId(taskInstance.getExecutionId()); result.setFormKey(taskInstance.getFormKey()); result.setId(taskInstance.getId());
assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no execution id", historicTaskInstance.getExecutionId()); assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no process definition id", historicTaskInstance.getProcessDefinitionId()); assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no task definition key", historicTaskInstance.getTaskDefinitionKey());