public void fireEvent(String taskEventName) { List<TaskListener> taskEventListeners = getListenersForEvent(taskEventName); if (taskEventListeners != null) { for (TaskListener taskListener : taskEventListeners) { CoreExecution execution = getExecution(); if (execution == null) { execution = getCaseExecution(); } if (execution != null) { setEventName(taskEventName); } try { TaskListenerInvocation listenerInvocation = new TaskListenerInvocation(taskListener, this, execution); Context.getProcessEngineConfiguration() .getDelegateInterceptor() .handleInvocation(listenerInvocation); } catch (Exception e) { throw LOG.invokeTaskListenerException(e); } } } }
public void fireEvent(String taskEventName) { List<TaskListener> taskEventListeners = getListenersForEvent(taskEventName); if (taskEventListeners != null) { for (TaskListener taskListener : taskEventListeners) { CoreExecution execution = getExecution(); if (execution == null) { execution = getCaseExecution(); } if (execution != null) { setEventName(taskEventName); } try { TaskListenerInvocation listenerInvocation = new TaskListenerInvocation(taskListener, this, execution); Context.getProcessEngineConfiguration() .getDelegateInterceptor() .handleInvocation(listenerInvocation); } catch (Exception e) { throw LOG.invokeTaskListenerException(e); } } } }
public void testTaskEntitySerialization() throws Exception { TaskEntity task = new TaskEntity(); task.setDelegationState(DelegationState.RESOLVED); task.setExecution(new ExecutionEntity()); task.setProcessInstance(new ExecutionEntity()); task.setTaskDefinition(new TaskDefinition(null)); task.setAssignee("kermit"); task.setCreateTime(new Date()); task.setDescription("Test description"); task.setDueDate(new Date()); task.setName("myTask"); task.setEventName("end"); task.setDeleted(false); task.setDelegationStateString(DelegationState.RESOLVED.name()); byte[] data = writeObject(task); task = (TaskEntity) readObject(data); assertEquals("kermit", task.getAssignee()); assertEquals("myTask", task.getName()); assertEquals("end", task.getEventName()); }
public void fireEvent(String taskEventName) { List<TaskListener> taskEventListeners = getListenersForEvent(taskEventName); if (taskEventListeners != null) { for (TaskListener taskListener : taskEventListeners) { CoreExecution execution = getExecution(); if (execution == null) { execution = getCaseExecution(); } if (execution != null) { setEventName(taskEventName); } try { TaskListenerInvocation listenerInvocation = new TaskListenerInvocation(taskListener, this, execution); Context.getProcessEngineConfiguration() .getDelegateInterceptor() .handleInvocation(listenerInvocation); } catch (Exception e) { throw LOG.invokeTaskListenerException(e); } } } }
public void testTaskEntitySerialization() throws Exception { TaskEntity task = new TaskEntity(); task.setDelegationState(DelegationState.RESOLVED); task.setExecution(new ExecutionEntity()); task.setProcessInstance(new ExecutionEntity()); task.setTaskDefinition(new TaskDefinition(null)); task.setAssignee("kermit"); task.setCreateTime(new Date()); task.setDescription("Test description"); task.setDueDate(new Date()); task.setName("myTask"); task.setEventName("end"); task.setDeleted(false); task.setDelegationStateString(DelegationState.RESOLVED.name()); byte[] data = writeObject(task); task = (TaskEntity) readObject(data); assertEquals("kermit", task.getAssignee()); assertEquals("myTask", task.getName()); assertEquals("end", task.getEventName()); }