processInstanceList = query.orderByProcessInstanceStartTime().desc().listPage((pageInfo.getPageNum() - 1) * pageInfo.getPageSize(), pageInfo.getPageSize());
@SuppressWarnings("unchecked") private List<WorkflowInstance> getWorkflowsInternal(WorkflowInstanceQuery workflowInstanceQuery, boolean isActive, int maxItems, int skipCount) { // MNT-9074 My Tasks fails to render if tasks quantity is excessive HistoricProcessInstanceQuery query = createQuery(workflowInstanceQuery, isActive); LinkedList<WorkflowInstance> results = new LinkedList<WorkflowInstance>(); List<HistoricProcessInstance> completedInstances; if (maxItems > 0) { completedInstances = query.orderByProcessInstanceDuration().desc().listPage(skipCount, maxItems); } else { completedInstances = query.list(); } List<WorkflowInstance> completedResults = typeConverter.doSpecialTenantFilterAndSafeConvert(completedInstances, new Function<HistoricProcessInstance, String>() { public String apply(HistoricProcessInstance historicProcessInstance) { ProcessDefinition procDef = activitiUtil.getProcessDefinition(historicProcessInstance.getProcessDefinitionId()); return procDef.getKey(); } }); results.addAll(completedResults); return results; }
@SuppressWarnings("unchecked") private List<WorkflowInstance> getWorkflowsInternal(WorkflowInstanceQuery workflowInstanceQuery, boolean isActive, int maxItems, int skipCount) { // MNT-9074 My Tasks fails to render if tasks quantity is excessive HistoricProcessInstanceQuery query = createQuery(workflowInstanceQuery, isActive); LinkedList<WorkflowInstance> results = new LinkedList<WorkflowInstance>(); List<HistoricProcessInstance> completedInstances; if (maxItems > 0) { completedInstances = query.orderByProcessInstanceDuration().desc().listPage(skipCount, maxItems); } else { completedInstances = query.list(); } List<WorkflowInstance> completedResults = typeConverter.doSpecialTenantFilterAndSafeConvert(completedInstances, new Function<HistoricProcessInstance, String>() { public String apply(HistoricProcessInstance historicProcessInstance) { ProcessDefinition procDef = activitiUtil.getProcessDefinition(historicProcessInstance.getProcessDefinitionId()); return procDef.getKey(); } }); results.addAll(completedResults); return results; }
protected void refreshInstances(String processDefinitionId) { instanceList = historyService.createHistoricProcessInstanceQuery() .processDefinitionId(processDefinitionId) .orderByProcessInstanceStartTime() .desc() .list(); instanceTable.removeAllItems(); fillInstanceValues(); }
protected void initializeCurrentValues() { if (ExplorerApp.get().getCrystalBallSimulationDebugger() != null) { this.simulationDebugger = ExplorerApp.get().getCrystalBallSimulationDebugger(); this.simulationEvents = ExplorerApp.get().getCrystalBallSimulationEvents(); String selectedDefinitionId = ExplorerApp.get().getCrystalBallCurrentDefinitionId(); if (selectedDefinitionId != null) { definitionSelect.setValue(selectedDefinitionId); } String selectedInstanceId = ExplorerApp.get().getCrystalBallCurrentInstanceId(); if (selectedInstanceId != null) { instanceTable.setValue(selectedInstanceId); } List<HistoricProcessInstance> replayProcessInstanceList = historyService.createHistoricProcessInstanceQuery() .processInstanceBusinessKey(SIMULATION_BUSINESS_KEY) .orderByProcessInstanceStartTime() .desc() .list(); if (replayProcessInstanceList != null && !replayProcessInstanceList.isEmpty()) { replayHistoricInstance = replayProcessInstanceList.get(0); } refreshEvents(); } }
.processInstanceBusinessKey(SIMULATION_BUSINESS_KEY) .orderByProcessInstanceStartTime() .desc() .list(); if (replayProcessInstanceList != null && !replayProcessInstanceList.isEmpty()) {
public EventOverviewPanel() { this.runtimeService = ProcessEngines.getDefaultProcessEngine().getRuntimeService(); this.historyService = ProcessEngines.getDefaultProcessEngine().getHistoryService(); this.repositoryService = ProcessEngines.getDefaultProcessEngine().getRepositoryService(); this.identityService = ProcessEngines.getDefaultProcessEngine().getIdentityService(); this.managementService = ProcessEngines.getDefaultProcessEngine().getManagementService(); this.variableRendererManager = ExplorerApp.get().getVariableRendererManager(); this.definitionList = repositoryService.createProcessDefinitionQuery().orderByProcessDefinitionName().asc().list(); this.instanceList = historyService.createHistoricProcessInstanceQuery().orderByProcessInstanceStartTime().desc().list(); this.i18nManager = ExplorerApp.get().getI18nManager(); initializeDefinitionMap(); init(); initializeCurrentValues(); }