public virtual void testOnBoundaryEvents() { RecorderExecutionListener.Clear(); var processInstance = runtimeService.StartProcessInstanceByKey("process"); var firstTimer = managementService.CreateJobQuery() /*.Timers()*/ .First(); managementService.ExecuteJob(firstTimer.Id); var secondTimer = managementService.CreateJobQuery() /*.Timers()*/ .First(); managementService.ExecuteJob(secondTimer.Id); assertProcessEnded(processInstance.Id); var recordedEvents = RecorderExecutionListener.RecordedEvents; Assert.AreEqual(2, recordedEvents.Count); Assert.AreEqual("timer1", recordedEvents[0].ActivityId); Assert.AreEqual("start boundary listener", recordedEvents[0].Parameter); Assert.AreEqual("start", recordedEvents[0].EventName); Assert.That(recordedEvents[0].Canceled, Is.EqualTo(false)); Assert.AreEqual("timer2", recordedEvents[1].ActivityId); Assert.AreEqual("end boundary listener", recordedEvents[1].Parameter); Assert.AreEqual("end", recordedEvents[1].EventName); Assert.That(recordedEvents[1].Canceled, Is.EqualTo(false)); }
public virtual void testExecutionListenerOnTerminateEndEvent() { RecorderExecutionListener.Clear(); runtimeService.StartProcessInstanceByKey("oneTaskProcess"); var task = taskService.CreateTaskQuery() .First(); taskService.Complete(task.Id); var recordedEvents = RecorderExecutionListener.RecordedEvents; Assert.AreEqual(2, recordedEvents.Count); Assert.AreEqual("start", recordedEvents[0].EventName); Assert.AreEqual("end", recordedEvents[1].EventName); }
public virtual void testOnCancellingBoundaryEvents() { RecorderExecutionListener.Clear(); var processInstance = runtimeService.StartProcessInstanceByKey("process"); var timer = managementService.CreateJobQuery() /*.Timers()*/ .First(); managementService.ExecuteJob(timer.Id); assertProcessEnded(processInstance.Id); var recordedEvents = RecorderExecutionListener.RecordedEvents; //Assert.That(recordedEvents, hasSize(1)); Assert.AreEqual("UserTask_1", recordedEvents[0].ActivityId); Assert.AreEqual("end", recordedEvents[0].EventName); Assert.That(recordedEvents[0].Canceled, Is.EqualTo(true)); }
public virtual void testExecutionListenersOnStartEndEvents() { RecorderExecutionListener.Clear(); var processInstance = runtimeService.StartProcessInstanceByKey("executionListenersProcess"); assertProcessEnded(processInstance.Id); var recordedEvents = RecorderExecutionListener.RecordedEvents; Assert.AreEqual(4, recordedEvents.Count); Assert.AreEqual("theStart", recordedEvents[0].ActivityId); Assert.AreEqual("Start Event", recordedEvents[0].ActivityName); Assert.AreEqual("Start Event Listener", recordedEvents[0].Parameter); Assert.AreEqual("end", recordedEvents[0].EventName); Assert.That(recordedEvents[0].Canceled, Is.EqualTo(false)); Assert.AreEqual("noneEvent", recordedEvents[1].ActivityId); Assert.AreEqual("None Event", recordedEvents[1].ActivityName); Assert.AreEqual("Intermediate Catch Event Listener", recordedEvents[1].Parameter); Assert.AreEqual("end", recordedEvents[1].EventName); Assert.That(recordedEvents[1].Canceled, Is.EqualTo(false)); Assert.AreEqual("signalEvent", recordedEvents[2].ActivityId); Assert.AreEqual("Signal Event", recordedEvents[2].ActivityName); Assert.AreEqual("Intermediate Throw Event Listener", recordedEvents[2].Parameter); Assert.AreEqual("start", recordedEvents[2].EventName); Assert.That(recordedEvents[2].Canceled, Is.EqualTo(false)); Assert.AreEqual("theEnd", recordedEvents[3].ActivityId); Assert.AreEqual("End Event", recordedEvents[3].ActivityName); Assert.AreEqual("End Event Listener", recordedEvents[3].Parameter); Assert.AreEqual("start", recordedEvents[3].EventName); Assert.That(recordedEvents[3].Canceled, Is.EqualTo(false)); }
public virtual void clearRecorderListener() { RecorderExecutionListener.Clear(); }