protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update) { var execErrors = new ErrorResultTO(); tmpErrors = new ErrorResultTO(); tmpErrors.MergeErrors(execErrors); if (string.IsNullOrEmpty(ProcedureName)) { tmpErrors.AddError(ErrorResource.NoActionsInSelectedDB); return; } if (ServiceExecution is DatabaseServiceExecution databaseServiceExecution) { if (databaseServiceExecution.SourceIsNull()) { databaseServiceExecution.GetSource(SourceId); } databaseServiceExecution.Inputs = Inputs.Select(a => new ServiceInput { EmptyIsNull = a.EmptyIsNull, Name = a.Name, RequiredField = a.RequiredField, Value = a.Value, TypeName = a.TypeName } as IServiceInput).ToList(); databaseServiceExecution.Outputs = Outputs; } ServiceExecution.Execute(out execErrors, update); var fetchErrors = execErrors.FetchErrors(); foreach (var error in fetchErrors) { dataObject.Environment.Errors.Add(error); } tmpErrors.MergeErrors(execErrors); }
protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO errors, int update) { var execErrors = new ErrorResultTO(); errors = new ErrorResultTO(); errors.MergeErrors(execErrors); if (string.IsNullOrEmpty(CommandText)) { errors.AddError(ErrorResource.NoActionsInSelectedDB); return; } var databaseServiceExecution = ServiceExecution as DatabaseServiceExecution; if (databaseServiceExecution != null) { databaseServiceExecution.Inputs = Inputs.Select(a => new ServiceInput { EmptyIsNull = a.EmptyIsNull, Name = a.Name, RequiredField = a.RequiredField, Value = a.Value, TypeName = a.TypeName } as IServiceInput).ToList(); databaseServiceExecution.Outputs = Outputs; } ServiceExecution.Execute(out execErrors, update); var fetchErrors = execErrors.FetchErrors(); foreach (var error in fetchErrors) { dataObject.Environment.Errors.Add(error); } errors.MergeErrors(execErrors); }
public WorkSession(WorkConfiguration workConfiguration, IWorkEnvironment workEnvironment) { sessionReport = workConfiguration.CreateSessionReport(); ServiceExecution serviceExecution = ServiceExecution.Create(workEnvironment); whiteExecution = WhiteExecution.Create(serviceExecution, sessionReport); whiteExecution.ServiceExecution.RevertToSnapshot(); }
/// <summary> /// Attaches the service provider to the address. /// </summary> /// <param name="addr">The service address.</param> /// <param name="type">The service type.</param> /// <param name="execution">The service execution.</param> /// <param name="behaviour">The service behaviour.</param> /// <returns>The attached service.</returns> public Task <Service> AttachAsync(ServiceAddress addr, ServiceType type, ServiceExecution execution, ServiceBehaviour behaviour) { return(AttachAsync(addr, new ServiceConfiguration() { Type = type, Execution = execution }, behaviour)); }
protected override void BeforeExecutionStart(IDSFDataObject dataObject, ErrorResultTO tmpErrors) { base.BeforeExecutionStart(dataObject, tmpErrors); var databaseServiceExecution = new DatabaseServiceExecution(dataObject); if (CommandTimeout != null) { databaseServiceExecution.CommandTimeout = CommandTimeout.Value; } databaseServiceExecution.ProcedureName = databaseServiceExecution.OdbcMethod(CommandText); ServiceExecution = databaseServiceExecution; ServiceExecution.GetSource(SourceId); ServiceExecution.BeforeExecution(tmpErrors); }
private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (!(e.Error == null)) { Console.WriteLine("Error: " + e.Error.Message); } else { if (allDone == toDo) { foreach (string file in infectedFiles) { ServiceExecution.GetInstance().sendResultsToClient(file); } ServiceExecution.GetInstance().sendResultsToClient("done", true); } } }
protected override void BeforeExecutionStart(IDSFDataObject dataObject, ErrorResultTO tmpErrors) { base.BeforeExecutionStart(dataObject, tmpErrors); var databaseServiceExecution = new DatabaseServiceExecution(dataObject) { ProcedureName = ProcedureName, }; if (CommandTimeout != null) { databaseServiceExecution.CommandTimeout = CommandTimeout.Value; } if (!string.IsNullOrEmpty(ExecuteActionString)) { databaseServiceExecution.ProcedureName = ExecuteActionString; } ServiceExecution = databaseServiceExecution; ServiceExecution.GetSource(SourceId); ServiceExecution.BeforeExecution(tmpErrors); }
public void SetUp() { @class = new Class(typeof(TestService)); executionHistory = new ExecutionHistory(); serviceExecution = new ServiceExecution(executionHistory, new NullWorkEnvironment()); }
protected override void AfterExecutionCompleted(ErrorResultTO tmpErrors) { base.AfterExecutionCompleted(tmpErrors); ServiceExecution.AfterExecution(tmpErrors); }
public ServiceInterceptor(Service service, ServiceExecution serviceExecution, IReport sessionReport) { this.service = service; this.serviceExecution = serviceExecution; this.sessionReport = sessionReport; }
/// <summary> /// Attaches the service provider to the address. /// </summary> /// <param name="addr">The address.</param> /// <param name="type">The service type.</param> /// <param name="execution">The service execution.</param> /// <param name="behaviour">The behaviour.</param> /// <returns>The attached service.</returns> public Task <Service> AttachAsync(string addr, ServiceType type, ServiceExecution execution, ServiceBehaviour behaviour) { return(AttachAsync(new ServiceAddress(addr), type, execution, behaviour)); }
public void Setup() { type = typeof(TestService); executionHistory = new ExecutionHistory(); serviceExecution = new ServiceExecution(executionHistory, new NullWorkEnvironment()); }
public ServiceExecutionTest() { type = typeof(TestService); executionHistory = new ExecutionHistory(); serviceExecution = new ServiceExecution(executionHistory, new NullWorkEnvironment()); }