public NameValueCollection Extract(NameValueCollection form) { var taskDefitionId = form.Get("taskDefitionId"); Bpmn.Task task = null; if (StartEvent.Any(t => t.Id == taskDefitionId)) { task = StartEvent.Single(t => t.Id == taskDefitionId); } if (EndEvent.Any(t => t.Id == taskDefitionId)) { task = EndEvent.Single(t => t.Id == taskDefitionId); } if (UserTask.Any(t => t.Id == taskDefitionId)) { task = UserTask.Single(t => t.Id == taskDefitionId); } return(task.Extract(form)); }