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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public WorkSession(WorkConfiguration workConfiguration, IWorkEnvironment workEnvironment)
        {
            sessionReport = workConfiguration.CreateSessionReport();
            ServiceExecution serviceExecution = ServiceExecution.Create(workEnvironment);

            whiteExecution = WhiteExecution.Create(serviceExecution, sessionReport);
            whiteExecution.ServiceExecution.RevertToSnapshot();
        }
Пример #4
0
 /// <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));
 }
Пример #5
0
        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);
        }
Пример #6
0
 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);
         }
     }
 }
Пример #7
0
        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);
        }
Пример #8
0
 public void SetUp()
 {
     @class = new Class(typeof(TestService));
     executionHistory = new ExecutionHistory();
     serviceExecution = new ServiceExecution(executionHistory, new NullWorkEnvironment());
 }
Пример #9
0
 protected override void AfterExecutionCompleted(ErrorResultTO tmpErrors)
 {
     base.AfterExecutionCompleted(tmpErrors);
     ServiceExecution.AfterExecution(tmpErrors);
 }
Пример #10
0
 public void SetUp()
 {
     @class           = new Class(typeof(TestService));
     executionHistory = new ExecutionHistory();
     serviceExecution = new ServiceExecution(executionHistory, new NullWorkEnvironment());
 }
Пример #11
0
 public ServiceInterceptor(Service service, ServiceExecution serviceExecution, IReport sessionReport)
 {
     this.service = service;
     this.serviceExecution = serviceExecution;
     this.sessionReport = sessionReport;
 }
Пример #12
0
 /// <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());
 }
Пример #14
0
 public ServiceExecutionTest()
 {
     type = typeof(TestService);
     executionHistory = new ExecutionHistory();
     serviceExecution = new ServiceExecution(executionHistory, new NullWorkEnvironment());
 }