protected JPAAuditLogService getJpaAuditLogService() { JPAAuditLogService jpaAuditLogService = this.jpaAuditService; if( jpaAuditLogService == null ) { jpaAuditLogService = this.executor.execute(getJpaAuditLogServiceCommand); } return jpaAuditLogService; }
protected JPAAuditLogService getJpaAuditLogService() { JPAAuditLogService jpaAuditLogService = this.jpaAuditService; if( jpaAuditLogService == null ) { jpaAuditLogService = this.executor.execute(getJpaAuditLogServiceCommand); } return jpaAuditLogService; }
@Override public List<ProcessInstanceLog> findActiveProcessInstances(String processId) { return executor.execute(new FindActiveProcessInstancesCommand(processId)); }
@Override public void clear() { executor.execute(new ClearHistoryLogsCommand()); }
@Override public ProcessInstanceLog findProcessInstance(long processInstanceId) { return executor.execute(new FindProcessInstanceCommand(processInstanceId)); }
@Override public List<VariableInstanceLog> findVariableInstances(long processInstanceId, String variableId) { return executor.execute(new FindVariableInstancesCommand(processInstanceId, variableId)); }
@Override @SuppressWarnings("unchecked") public <T, R> List<R> queryLogs( QueryWhere queryWhere, Class<T> queryClass, Class<R> resultClass ) { if( queryClass.equals(NodeInstanceLog.class) ) { return (List<R>) executor.execute(new AuditNodeInstanceLogQueryCommand(queryWhere)); } else if( queryClass.equals(ProcessInstanceLog.class) ) { return (List<R>) executor.execute(new AuditProcessInstanceLogQueryCommand(queryWhere)); } else if( queryClass.equals(VariableInstanceLog.class) ) { return (List<R>) executor.execute(new AuditVariableInstanceLogQueryCommand(queryWhere)); } else { String type = queryClass == null ? "null" : queryClass.getName(); throw new IllegalArgumentException("Unknown type for query:" + type ); } }
@Override public List<ProcessInstanceLog> findProcessInstances(String processId) { return executor.execute(new FindProcessInstancesCommand(processId)); }
@Override public List<NodeInstanceLog> findNodeInstances(long processInstanceId, String nodeId) { return executor.execute(new FindNodeInstancesCommand(processInstanceId, nodeId)); }
@Override public List<VariableInstanceLog> findVariableInstancesByNameAndValue(String variableId, String value, boolean activeProcesses) { return executor.execute(new FindVariableInstancesByNameCommand(variableId, value, activeProcesses)); }
@Override public List<ProcessInstanceLog> findProcessInstances() { return executor.execute(new FindProcessInstancesCommand()); }
@Override public List<ProcessInstanceLog> findSubProcessInstances(long processInstanceId) { return executor.execute(new FindSubProcessInstancesCommand(processInstanceId)); }
@Override public List<VariableInstanceLog> findVariableInstancesByName(String variableId, boolean activeProcesses) { return executor.execute(new FindVariableInstancesByNameCommand(variableId, activeProcesses)); }
@Override public List<ProcessInstanceLog> findActiveProcessInstances() { return executor.execute(new FindActiveProcessInstancesCommand()); }
@Override public List<NodeInstanceLog> findNodeInstances(long processInstanceId) { return executor.execute(new FindNodeInstancesCommand(processInstanceId)); }
@Override public List<VariableInstanceLog> findVariableInstances(long processInstanceId) { return executor.execute(new FindVariableInstancesCommand(processInstanceId)); }
@Override public List<TaskSummary> getResultList() { TaskSummaryQueryCommand cmd = new TaskSummaryQueryCommand(queryWhere); cmd.setUserId(userId); return executor.execute(cmd); } };
public static synchronized void initialize(CommandExecutor instance) { if (instance != null) { TaskDeadlinesServiceImpl.instance = instance; getInstance().execute(new InitDeadlinesCommand()); } }
@Override public void execute(JobContext ctx) { RuntimeManager runtimeManager = null; RuntimeEngine engine = null; CommandExecutor executor = null; if (deploymentId != null && processInstanceId != null) { runtimeManager = RuntimeManagerRegistry.get().getManager(deploymentId); engine = runtimeManager.getRuntimeEngine(ProcessInstanceIdContext.get(processInstanceId)); executor = engine.getTaskService(); } else { executor = TaskDeadlinesServiceImpl.getInstance(); } try { executor.execute(new ExecuteDeadlinesCommand(taskId, deadlineId, type)); } catch (NullPointerException e) { logger.error("TaskDeadlineService instance is not available, most likely was not properly initialized - Job did not run!"); } finally { if (runtimeManager != null && engine != null) { runtimeManager.disposeRuntimeEngine(engine); } } }
public ScheduledTaskDeadline call() throws Exception { RuntimeManager runtimeManager = null; RuntimeEngine engine = null; CommandExecutor executor = null; if (deploymentId != null && processInstanceId != null) { runtimeManager = RuntimeManagerRegistry.get().getManager(deploymentId); engine = runtimeManager.getRuntimeEngine(ProcessInstanceIdContext.get(processInstanceId)); executor = engine.getTaskService(); } else { executor = TaskDeadlinesServiceImpl.getInstance(); } try { executor.execute(new ExecuteDeadlinesCommand(taskId, deadlineId, type)); } catch (NullPointerException e) { logger.error("TaskDeadlineService instance is not available, most likely was not properly initialized - Job did not run!"); } finally { if (runtimeManager != null && engine != null) { runtimeManager.disposeRuntimeEngine(engine); } } return null; }