//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Deployment public void testTaskListener() public virtual void testTaskListener() { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.List<String> events = new java.util.ArrayList<String>(); IList <string> events = new List <string>(); EmbeddedProcessApplication processApplication = new EmbeddedProcessApplicationAnonymousInnerClass8(this, events); // register app so that it is notified about events managementService.registerProcessApplication(deploymentId, processApplication.Reference); // start process instance ProcessInstance taskListenerProcess = runtimeService.startProcessInstanceByKey("taskListenerProcess"); // create event received assertEquals(1, events.Count); assertEquals([email protected]_Fields.EVENTNAME_CREATE, events[0]); Task task = taskService.createTaskQuery().singleResult(); //assign task: taskService.setAssignee(task.Id, "jonny"); assertEquals(2, events.Count); assertEquals([email protected]_Fields.EVENTNAME_ASSIGNMENT, events[1]); // complete task taskService.complete(task.Id); assertEquals(4, events.Count); assertEquals([email protected]_Fields.EVENTNAME_COMPLETE, events[2]); // next task was created assertEquals([email protected]_Fields.EVENTNAME_CREATE, events[3]); // delete process instance so last task will be deleted runtimeService.deleteProcessInstance(taskListenerProcess.ProcessInstanceId, "test delete event"); assertEquals(5, events.Count); assertEquals([email protected]_Fields.EVENTNAME_DELETE, events[4]); }
public TaskListenerAnonymousInnerClass(EmbeddedProcessApplicationAnonymousInnerClass8 outerInstance) { this.outerInstance = outerInstance; }