public CompletionReport TestBehavior(Behavior b) { IOperationalBehavior operBehavior = null; try { testMode = true; Console.WriteLine("Testing behavior " + b.ToString() + " -- type " + b.GetType().Name); cachedCompletionReport = new SuccessCompletionReport(b.GetType()); HandleDecorators(b.Decorators); operBehavior = MapBehavior(b); operBehavior.Initialize(b); operBehavior.Process(null); Console.WriteLine("Result: " + cachedCompletionReport.ToString()); cachedCompletionReport.BehaviorId = b.UniqueId(); return(cachedCompletionReport); } catch (Exception ex) { TraceSource.TraceEvent(TraceEventType.Error, 0, "error testing behavior {0}: {1}", b.GetType(), ex); throw; } finally { if (operBehavior != null && operBehavior is IDisposable) { ((IDisposable)operBehavior).Dispose(); } } }
internal void SendCompletionReport(string executionNodeID, CompletionReport report) { if (localOnly) { logger.Info("Completion Report"); logger.Info(report); } else { logger.Info("Completion Report"); logger.Info(report.ToString()); Task.Run(() => { this.hubProxy.Invoke("CompletionReportResponse", executionNodeID, report); }); } }
public void ForwardCompletionReport(CompletionReport report) { if (testMode) { cachedCompletionReport = report; Console.WriteLine("forward comp report: " + report.ToString()); } else { if (report is TrajectoryBlockedReport) { ((TrajectoryBlockedReport)report).SAUDILevel = saudiLevel; } if (Services.Operational != null) { Services.Operational.SendCompletionReport(report); } } }