private Execution findCurrentExecution(List<Execution> currentExecutionsForProcess) { return currentExecutionsForProcess.stream() .filter(execution -> execution.getActivityId() != null) .findFirst() .orElse(null); }
private Execution findCurrentExecution(List<Execution> currentExecutionsForProcess) { return currentExecutionsForProcess.stream() .filter(execution -> execution.getActivityId() != null) .findFirst() .orElse(null); }
public Execution getProcessExecution(String processInstanceId) { return getExecutionsByProcessId(processInstanceId).stream() .filter(execution -> execution.getActivityId() != null) .findFirst() .orElse(null); }
private List<String> findFailedActivityIds(String superProcessInstanceId) { List<Execution> executionsForProcess = flowableFacade.getActiveProcessExecutions(superProcessInstanceId); return executionsForProcess.stream() .map(e -> e.getActivityId()) .collect(Collectors.toList()); }
public List<Execution> getActiveProcessExecutions(String processInstanceId) { List<Execution> allProcessExecutions = getAllProcessExecutions(processInstanceId); return allProcessExecutions.stream() .filter(e -> e.getActivityId() != null) .collect(Collectors.toList()); }
private String getCurrentTaskId(FlowableEngineEvent flowableEngineEvent) { Execution currentExecutionForProces = findCurrentExecution(flowableEngineEvent); return currentExecutionForProces != null ? currentExecutionForProces.getActivityId() : getVariable(flowableEngineEvent, Constants.TASK_ID); }
private String getCurrentTaskId(FlowableEngineEvent flowableEngineEvent) { Execution currentExecutionForProces = findCurrentExecution(flowableEngineEvent); return currentExecutionForProces != null ? currentExecutionForProces.getActivityId() : getVariable(flowableEngineEvent, Constants.TASK_ID); }
private String getCurrentActivityId(DelegateExecution context) { List<Execution> processExecutions = processEngineConfiguration.getRuntimeService() .createExecutionQuery() .processInstanceId(context.getProcessInstanceId()) .list(); List<Execution> processExecutionsWithActivityIds = processExecutions.stream() .filter(e -> e.getActivityId() != null) .collect(Collectors.toList()); if (processExecutionsWithActivityIds.isEmpty()) { // if this happen then there is a really big problem with Flowable :) throw new SLException("There are no executions for process with id: " + context.getProcessInstanceId()); } return processExecutionsWithActivityIds.get(0) .getActivityId(); }
private String getCurrentActivityId(DelegateExecution context) { List<Execution> processExecutions = processEngineConfiguration.getRuntimeService() .createExecutionQuery() .processInstanceId(context.getProcessInstanceId()) .list(); List<Execution> processExecutionsWithActivityIds = processExecutions.stream() .filter(e -> e.getActivityId() != null) .collect(Collectors.toList()); if (processExecutionsWithActivityIds.isEmpty()) { // if this happen then there is a really big problem with Flowable :) throw new SLException("There are no executions for process with id: " + context.getProcessInstanceId()); } return processExecutionsWithActivityIds.get(0) .getActivityId(); }
private List<HistoricActivityInstance> findCurrentActivitiesAtReceiveTask(Execution execution) { return processEngine.getHistoryService() .createHistoricActivityInstanceQuery() .activityId(execution.getActivityId()) .executionId(execution.getId()) .activityType("receiveTask") .list(); }
currentElements.add(executionMap.get(job.getExecutionId()).getActivityId());