protected void localize(HistoricTaskInstance task) { HistoricTaskInstanceEntity taskEntity = (HistoricTaskInstanceEntity) task; taskEntity.setLocalizedName(null); taskEntity.setLocalizedDescription(null); if (locale != null) { String processDefinitionId = task.getProcessDefinitionId(); if (processDefinitionId != null) { ObjectNode languageNode = Context.getLocalizationElementProperties(locale, task.getTaskDefinitionKey(), processDefinitionId, withLocalizationFallback); if (languageNode != null) { JsonNode languageNameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME); if (languageNameNode != null && !languageNameNode.isNull()) { taskEntity.setLocalizedName(languageNameNode.asText()); } JsonNode languageDescriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION); if (languageDescriptionNode != null && !languageDescriptionNode.isNull()) { taskEntity.setLocalizedDescription(languageDescriptionNode.asText()); } } } } }
assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no process instance id", historicTaskInstance.getProcessInstanceId()); 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()); assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no create time", historicTaskInstance.getCreateTime());
public String apply(HistoricTaskInstance task) { String defId = task.getProcessDefinitionId(); ProcessDefinition definition = (ProcessDefinition) activitiUtil.getDeployedProcessDefinition(defId); return definition.getKey(); } });
public String apply(HistoricTaskInstance task) { String defId = task.getProcessDefinitionId(); ProcessDefinition definition = (ProcessDefinition) activitiUtil.getDeployedProcessDefinition(defId); return definition.getKey(); } });
protected void localize(HistoricTaskInstance task) { HistoricTaskInstanceEntity taskEntity = (HistoricTaskInstanceEntity) task; taskEntity.setLocalizedName(null); taskEntity.setLocalizedDescription(null); if (locale != null) { String processDefinitionId = task.getProcessDefinitionId(); if (processDefinitionId != null) { ObjectNode languageNode = Context.getLocalizationElementProperties(locale, task.getTaskDefinitionKey(), processDefinitionId, withLocalizationFallback); if (languageNode != null) { JsonNode languageNameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME); if (languageNameNode != null && languageNameNode.isNull() == false) { taskEntity.setLocalizedName(languageNameNode.asText()); } JsonNode languageDescriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION); if (languageDescriptionNode != null && languageDescriptionNode.isNull() == false) { taskEntity.setLocalizedDescription(languageDescriptionNode.asText()); } } } } }
protected void localize(HistoricTaskInstance task) { task.setLocalizedName(null); task.setLocalizedDescription(null); if (locale != null) { String processDefinitionId = task.getProcessDefinitionId(); if (processDefinitionId != null) { ObjectNode languageNode = Context.getLocalizationElementProperties(locale, task.getTaskDefinitionKey(), processDefinitionId, withLocalizationFallback); if (languageNode != null) { JsonNode languageNameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME); if (languageNameNode != null && !languageNameNode.isNull()) { task.setLocalizedName(languageNameNode.asText()); } JsonNode languageDescriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION); if (languageDescriptionNode != null && !languageDescriptionNode.isNull()) { task.setLocalizedDescription(languageDescriptionNode.asText()); } } } } }
private WorkflowNode buildHistoricTaskWorkflowNode(HistoricTaskInstance historicTaskInstance) { ReadOnlyProcessDefinition procDef = activitiUtil.getDeployedProcessDefinition(historicTaskInstance.getProcessDefinitionId()); PvmActivity taskActivity = procDef.findActivity(historicTaskInstance.getTaskDefinitionKey()); return convert(taskActivity); }
private WorkflowNode buildHistoricTaskWorkflowNode(HistoricTaskInstance historicTaskInstance) { ReadOnlyProcessDefinition procDef = activitiUtil.getDeployedProcessDefinition(historicTaskInstance.getProcessDefinitionId()); PvmActivity taskActivity = procDef.findActivity(historicTaskInstance.getTaskDefinitionKey()); return convert(taskActivity); }
myTaskHistoryVo.setOid("" + map.get("oid")); myTaskHistoryVo.setName(historicTaskInstance.getName()); myTaskHistoryVo.setProcessDefinitionId(historicTaskInstance.getProcessDefinitionId()); myTaskHistoryVo.setProcessInstanceId(historicTaskInstance.getProcessInstanceId()); myTaskHistoryVo.setStartTime(DateFormat.format(historicTaskInstance.getStartTime()));
@SuppressWarnings("deprecation") public LazyActivitiWorkflowTask(HistoricTaskInstance historicTask, ActivitiTypeConverter typeConverter, TenantService tenantService) { super(BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, historicTask.getId()), null, null, null, null, null, null, null); this.historicTask = historicTask; this.activitiTypeConverter = typeConverter; this.lazyPropertiesMap = new LazyPropertiesMap(); // Fetch task-definition and a partially-initialized WorkflowTask (not including properties and path) WorkflowTaskDefinition taskDefinition = activitiTypeConverter.getTaskDefinition(historicTask.getTaskDefinitionKey(), historicTask.getProcessDefinitionId()); String workflowDefinitionName = activitiTypeConverter.getWorkflowDefinitionName(historicTask.getProcessDefinitionId()); workflowDefinitionName = tenantService.getBaseName(workflowDefinitionName); WorkflowTask partiallyInitialized = typeConverter.getWorkflowObjectFactory().createTask(historicTask.getId(), taskDefinition, taskDefinition.getId(), historicTask.getName(), historicTask.getDescription(), WorkflowTaskState.COMPLETED, null, workflowDefinitionName , lazyPropertiesMap); this.definition = taskDefinition; this.name = taskDefinition.getId(); this.title = partiallyInitialized.getTitle(); this.description = partiallyInitialized.getDescription(); this.state = partiallyInitialized.getState(); }
@SuppressWarnings("deprecation") public LazyActivitiWorkflowTask(HistoricTaskInstance historicTask, ActivitiTypeConverter typeConverter, TenantService tenantService) { super(BPMEngineRegistry.createGlobalId(ActivitiConstants.ENGINE_ID, historicTask.getId()), null, null, null, null, null, null, null); this.historicTask = historicTask; this.activitiTypeConverter = typeConverter; this.lazyPropertiesMap = new LazyPropertiesMap(); // Fetch task-definition and a partially-initialized WorkflowTask (not including properties and path) WorkflowTaskDefinition taskDefinition = activitiTypeConverter.getTaskDefinition(historicTask.getTaskDefinitionKey(), historicTask.getProcessDefinitionId()); String workflowDefinitionName = activitiTypeConverter.getWorkflowDefinitionName(historicTask.getProcessDefinitionId()); workflowDefinitionName = tenantService.getBaseName(workflowDefinitionName); WorkflowTask partiallyInitialized = typeConverter.getWorkflowObjectFactory().createTask(historicTask.getId(), taskDefinition, taskDefinition.getId(), historicTask.getName(), historicTask.getDescription(), WorkflowTaskState.COMPLETED, null, workflowDefinitionName , lazyPropertiesMap); this.definition = taskDefinition; this.name = taskDefinition.getId(); this.title = partiallyInitialized.getTitle(); this.description = partiallyInitialized.getDescription(); this.state = partiallyInitialized.getState(); }
result.setParentTaskId(taskInstance.getParentTaskId()); result.setPriority(taskInstance.getPriority()); result.setProcessDefinitionId(taskInstance.getProcessDefinitionId()); result.setTenantId(taskInstance.getTenantId()); result.setCategory(taskInstance.getCategory()); if (taskInstance.getProcessDefinitionId() != null) { result.setProcessDefinitionUrl(urlBuilder.buildUrl(RestUrls.URL_PROCESS_DEFINITION, taskInstance.getProcessDefinitionId()));
private TaskInfoBean transToTaskInfoBean(HistoricTaskInstance task) { TaskInfoBean taskInfoBean = new TaskInfoBean(); taskInfoBean.setTaskDefinitionKey(task.getTaskDefinitionKey()); taskInfoBean.setFormKey(task.getFormKey()); taskInfoBean.setProcessDefinitionId(task.getProcessDefinitionId()); taskInfoBean.setProcessInstanceId(task.getProcessInstanceId()); taskInfoBean.setTaskName(task.getName()); taskInfoBean.setTaskId(task.getId()); taskInfoBean.setAssigneeId(task.getAssignee()); taskInfoBean.setTaskCreateTime(task.getCreateTime()); taskInfoBean.setTaskEndTime(task.getEndTime()); taskInfoBean.setTaskOwner(task.getOwner()); HistoricProcessInstance historicInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).includeProcessVariables().singleResult(); taskInfoBean.setItemsName(historicInstance.getProcessDefinitionName()); taskInfoBean.setVariables(historicInstance.getProcessVariables()); return taskInfoBean; }
assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no process instance id", historicTaskInstance.getProcessInstanceId()); 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()); assertNotNull("Historic task " + historicTaskInstance.getTaskDefinitionKey() + " has no create time", historicTaskInstance.getCreateTime());