protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO errors, int update)
        {
            errors = new ErrorResultTO();
            if (Headers == null)
            {
                errors.AddError(ErrorResource.HeadersAreNull);
                return;
            }
            if (QueryString == null)
            {
                errors.AddError(ErrorResource.QueryIsNull);
                return;
            }
            var head  = Headers.Select(a => new NameValue(ExecutionEnvironment.WarewolfEvalResultToString(dataObject.Environment.Eval(a.Name, update)), ExecutionEnvironment.WarewolfEvalResultToString(dataObject.Environment.Eval(a.Value, update))));
            var query = ExecutionEnvironment.WarewolfEvalResultToString(dataObject.Environment.Eval(QueryString, update));


            var url = ResourceCatalog.GetResource <WebSource>(Guid.Empty, SourceId);

            if (dataObject.IsDebugMode())
            {
                AddDebugInputItem(new DebugEvalResult(query, "URL", dataObject.Environment, update));
                AddDebugInputItem(new DebugEvalResult(url.Address, "Query String", dataObject.Environment, update));
            }
            var webRequestResult = PerformWebRequest(head, query, url);

            ResponseManager = new ResponseManager {
                OutputDescription = OutputDescription, Outputs = Outputs, IsObject = IsObject, ObjectName = ObjectName
            };
            ResponseManager.PushResponseIntoEnvironment(webRequestResult, update, dataObject);
        }
 public System.Guid MockExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out DataList.Contract.ErrorResultTO tmpErrors)
 {
     
     tmpErrors = new ErrorResultTO();
     tmpErrors.AddError("Something bad happened");
     return Guid.Empty;
 }
예제 #3
0
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            tmpErrors = new ErrorResultTO();
            var webRequestResult = string.Empty;

            try
            {
                var(head, query, putData) = ConfigureHttp(dataObject, update);

                var url = ResourceCatalog.GetResource <WebSource>(Guid.Empty, SourceId);
                webRequestResult = PerformWebRequest(head, query, url, putData, IsPutDataBase64);
            }
            catch (Exception ex)
            {
                tmpErrors.AddError(ex.Message);
            }
            finally
            {
                tmpErrors.MergeErrors(_errorsTo);

                var bytes    = webRequestResult.Base64StringToByteArray();
                var response = bytes.ReadToString();

                ResponseManager = new ResponseManager
                {
                    OutputDescription = OutputDescription,
                    Outputs           = Outputs,
                    IsObject          = IsObject,
                    ObjectName        = ObjectName
                };

                ResponseManager.PushResponseIntoEnvironment(response, update, dataObject);
            }
        }
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO errors)
        {
            var execErrors = new ErrorResultTO();
            var compiler   = DataListFactory.CreateDataListCompiler();
            var oldID      = dataObject.DataListID;

            errors = new ErrorResultTO();
            errors.MergeErrors(execErrors);

            var databaseServiceExecution = ServiceExecution as DatabaseServiceExecution;

            if (databaseServiceExecution != null)
            {
                databaseServiceExecution.InstanceInputDefinitions = inputs;  // set the output mapping for the instance ;)
                databaseServiceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
            }
            //ServiceExecution.DataObj = dataObject;
            var result      = ServiceExecution.Execute(out execErrors);
            var fetchErrors = execErrors.FetchErrors();

            foreach (var error in fetchErrors)
            {
                dataObject.Environment.Errors.Add(error);
            }

            errors.MergeErrors(execErrors);

            // Adjust the remaining output mappings ;)
            compiler.SetParentID(dataObject.DataListID, oldID);
            return(result);
        }
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            tmpErrors = new ErrorResultTO();
            try
            {
                if (Method == null)
                {
                    throw new Exception(ErrorResource.NoMethodSelected);
                }

                ExecuteService(update, out tmpErrors, Method, dataObject, OutputFormatterFactory.CreateOutputFormatter(OutputDescription));
            }
            catch (Exception err)
            {
                tmpErrors.AddError(err.Message);
            }
            finally
            {
                if (tmpErrors.HasErrors())
                {
                    foreach (var error in tmpErrors.FetchErrors())
                    {
                        dataObject.Environment.AddError(error);
                    }
                }
            }
        }
예제 #6
0
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
        {
            tmpErrors = new ErrorResultTO();
            ErrorResultTO invokeErrors;
            var           compiler            = DataListFactory.CreateDataListCompiler();
            var           oldID               = dataObject.DataListID;
            var           webserviceExecution = GetNewWebserviceExecution(dataObject);

#pragma warning disable 168
            var remainingMappings = esbChannel.ShapeForSubRequest(dataObject, inputs, outputs, out invokeErrors);
#pragma warning restore 168
            tmpErrors.MergeErrors(invokeErrors);

            if (webserviceExecution != null && !tmpErrors.HasErrors())
            {
                webserviceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
                var result = webserviceExecution.Execute(out invokeErrors);
                tmpErrors.MergeErrors(invokeErrors);

                // Adjust the remaining output mappings ;)
                compiler.SetParentID(dataObject.DataListID, oldID);

                compiler.ConvertFrom(dataObject.DataListID, DataListFormat.CreateFormat(GlobalConstants._XML_Without_SystemTags), enTranslationDepth.Data, out invokeErrors);
                tmpErrors.MergeErrors(invokeErrors);
                compiler.ConvertFrom(oldID, DataListFormat.CreateFormat(GlobalConstants._XML_Without_SystemTags), enTranslationDepth.Data, out invokeErrors);
                tmpErrors.MergeErrors(invokeErrors);
                return(result);
            }
            return(oldID);
        }
        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);
        }
예제 #8
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);
        }
예제 #9
0
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO errors, int update)
        {
            var execErrors = new ErrorResultTO();

            errors = new ErrorResultTO();
            errors.MergeErrors(execErrors);

            var databaseServiceExecution = ServiceExecution as DatabaseServiceExecution;
            if(databaseServiceExecution != null)
            {
                databaseServiceExecution.InstanceInputDefinitions = inputs; // set the output mapping for the instance ;)
                databaseServiceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
            }
            //ServiceExecution.DataObj = dataObject;
            var result = ServiceExecution.Execute(out execErrors, update);
            var fetchErrors = execErrors.FetchErrors();
            foreach(var error in fetchErrors)
            {
                dataObject.Environment.Errors.Add(error);
            }
            
            errors.MergeErrors(execErrors);

            // Adjust the remaining output mappings ;)
            return result;
        }
예제 #10
0
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            tmpErrors = new ErrorResultTO();
            IEnumerable <NameValue> head = null;

            if (Headers != null)
            {
                head = Headers.Select(a => new NameValue(ExecutionEnvironment.WarewolfEvalResultToString(dataObject.Environment.Eval(a.Name, update)), ExecutionEnvironment.WarewolfEvalResultToString(dataObject.Environment.Eval(a.Value, update))));
            }
            var query = "";

            if (QueryString != null)
            {
                query = ExecutionEnvironment.WarewolfEvalResultToString(dataObject.Environment.Eval(QueryString, update));
            }
            var putData = "";

            if (PutData != null)
            {
                putData = ExecutionEnvironment.WarewolfEvalResultToString(dataObject.Environment.Eval(PutData, update));
            }

            var url = ResourceCatalog.GetResource <WebSource>(Guid.Empty, SourceId);
            var webRequestResult = PerformWebRequest(head, query, url, putData);

            ResponseManager = new ResponseManager {
                OutputDescription = OutputDescription, Outputs = Outputs, IsObject = IsObject, ObjectName = ObjectName
            };
            ResponseManager.PushResponseIntoEnvironment(webRequestResult, update, dataObject);
        }
예제 #11
0
        protected virtual Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
        {
            Dev2Logger.Log.Info("PRE-SUB_EXECUTE SHAPE MEMORY USAGE [ " + BinaryDataListStorageLayer.GetUsedMemoryInMb().ToString("####.####") + " MBs ]");

            esbChannel.ExecuteSubRequest(dataObject, dataObject.WorkspaceID, inputs, outputs, out tmpErrors);
            Dev2Logger.Log.Info("POST-SUB_EXECUTE SHAPE MEMORY USAGE [ " + BinaryDataListStorageLayer.GetUsedMemoryInMb().ToString("####.####") + " MBs ]");
            return(Guid.NewGuid());
        }
예제 #12
0
 protected EsbExecutionContainer(ServiceAction sa, IDSFDataObject dataObject, IWorkspace theWorkspace, IEsbChannel esbChannel, EsbExecuteRequest request)
 {
     ServiceAction = sa;
     DataObject    = dataObject;
     TheWorkspace  = theWorkspace;
     EsbChannel    = esbChannel;
     Request       = request;
 }
예제 #13
0
        public EsbServiceInvoker(IEsbChannel esbChannel, IWorkspace workspace, EsbExecuteRequest request)
            : this(new ServiceLocator())
        {
            _esbChannel = esbChannel;

            _workspace = workspace;

            _request = request;
        }
예제 #14
0
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            tmpErrors = new ErrorResultTO();
            var webRequestResult = string.Empty;

            try
            {
                if (Headers == null)
                {
                    tmpErrors.AddError(ErrorResource.HeadersAreNull);
                    return;
                }

                if (QueryString == null)
                {
                    tmpErrors.AddError(ErrorResource.QueryIsNull);
                    return;
                }

                var(head, query, _) = ConfigureHttp(dataObject, update);

                var url = ResourceCatalog.GetResource <WebSource>(Guid.Empty, SourceId);

                if (dataObject.IsDebugMode())
                {
                    AddDebugInputItem(new DebugEvalResult(query, "URL", dataObject.Environment, update));
                    AddDebugInputItem(new DebugEvalResult(url.Address, "Query String", dataObject.Environment, update));
                }

                webRequestResult = PerformWebRequest(head, query, url);
            }
            catch (Exception ex)
            {
                tmpErrors.AddError(ex.Message);
            }
            finally
            {
                tmpErrors.MergeErrors(_errorsTo);

                ResponseManager = new ResponseManager
                {
                    OutputDescription = OutputDescription,
                    Outputs           = Outputs,
                    IsObject          = IsObject,
                    ObjectName        = ObjectName
                };
            }

            if (IsResponseBase64)
            {
                ResponseManager.PushResponseIntoEnvironment(webRequestResult, update, dataObject);
                return;
            }

            webRequestResult = Scrubber.Scrub(webRequestResult);
            ResponseManager.PushResponseIntoEnvironment(webRequestResult, update, dataObject);
        }
 protected EsbExecutionContainer(ServiceAction sa, IDSFDataObject dataObject, IWorkspace theWorkspace, IEsbChannel esbChannel, EsbExecuteRequest request)
 {
     ServiceAction = sa;
     DataObject = dataObject;
     TheWorkspace = theWorkspace;
     EsbChannel = esbChannel;
     Request = request;
     DataObject.EsbChannel = EsbChannel;
 }
예제 #16
0
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            _dataObject = dataObject;
            tmpErrors   = new ErrorResultTO();
            var webRequestResult = string.Empty;

            try
            {
                var(head, query, postData, conditions) = GetEnvironmentInputVariables(_dataObject.Environment, update);

                var source              = ResourceCatalog.GetResource <WebSource>(Guid.Empty, SourceId);
                var isManualChecked     = Convert.ToBoolean(Settings?.FirstOrDefault(s => s.Name == nameof(IsManualChecked))?.Value);
                var isFormDataChecked   = Convert.ToBoolean(Settings?.FirstOrDefault(s => s.Name == nameof(IsFormDataChecked))?.Value);
                var isUrlEncodedChecked = Convert.ToBoolean(Settings?.FirstOrDefault(s => s.Name == nameof(IsUrlEncodedChecked))?.Value);

                if (isManualChecked || isFormDataChecked || isUrlEncodedChecked)
                {
                    var webPostOptions = new WebPostOptions
                    {
                        Head                = head,
                        Headers             = head?.Select(h => h.Name + ":" + h.Value)?.ToArray() ?? new string[0],
                        Method              = WebRequestMethod.Post,
                        Parameters          = conditions,
                        Query               = query,
                        Source              = source,
                        PostData            = postData,
                        Settings            = Settings,
                        IsManualChecked     = isManualChecked,
                        IsFormDataChecked   = isFormDataChecked,
                        IsUrlEncodedChecked = isUrlEncodedChecked
                    };

                    webRequestResult = PerformWebPostRequest(webPostOptions);
                }
            }
            catch (Exception ex)
            {
                tmpErrors.AddError(ex.Message);
            }
            finally
            {
                tmpErrors.MergeErrors(_errorsTo);

                var bytes    = webRequestResult.Base64StringToByteArray();
                var response = bytes.ReadToString();

                ResponseManager = new ResponseManager
                {
                    OutputDescription = OutputDescription,
                    Outputs           = Outputs,
                    IsObject          = IsObject,
                    ObjectName        = ObjectName
                };
                response = Scrubber.Scrub(response);
                ResponseManager.PushResponseIntoEnvironment(response, update, dataObject);
            }
        }
 public RemoteWorkflowExecutionContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace workspace, IEsbChannel esbChannel, IResourceCatalog resourceCatalog)
     : base(sa, dataObj, workspace, esbChannel)
 {
     if (resourceCatalog == null)
     {
         throw new ArgumentNullException("resourceCatalog");
     }
     _resourceCatalog = resourceCatalog;
 }
예제 #18
0
 protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
 {
     tmpErrors = new ErrorResultTO();
     if (Method == null)
     {
         tmpErrors.AddError(ErrorResource.NoMethodSelected);
         return;
     }
     ExecuteService(update, out tmpErrors, Method, dataObject, OutputFormatterFactory.CreateOutputFormatter(OutputDescription));
 }
예제 #19
0
        // 2012.10.17 - 5782: TWR - Changed to work off the workspace host and made read only

        #region Constructors

        public EsbServiceInvoker(IEsbChannel esbChannel, IWorkspace workspace, EsbExecuteRequest request = null)
            : this(new ServiceLocator())
        {
            _esbChannel = esbChannel;


            // 2012.10.17 - 5782: TWR - Added workspace parameter
            _workspace = workspace;

            _request = request;
        }
예제 #20
0
 protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
 {
     _errorsTo = new ErrorResultTO();
     var pluginServiceExecution = GetNewPluginServiceExecution(dataObject);
     pluginServiceExecution.InstanceInputDefinitions = inputs;
     pluginServiceExecution.InstanceOutputDefintions = outputs;
     tmpErrors = new ErrorResultTO();
     tmpErrors.MergeErrors(_errorsTo);
     var result = ExecutePluginService(pluginServiceExecution, update);
     tmpErrors.MergeErrors(_errorsTo);
     return result;
 }
예제 #21
0
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO errors, int update)
        {
            errors = new ErrorResultTO();
            if (Method == null)
            {
                errors.AddError(ErrorResource.NoMethodSelected);
                return;
            }


            ExecuteService(update, out errors, Method, dataObject);
        }
예제 #22
0
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            _errorsTo = new ErrorResultTO();
            var pluginServiceExecution = GetNewPluginServiceExecution(dataObject);

            pluginServiceExecution.InstanceInputDefinitions = inputs;
            pluginServiceExecution.InstanceOutputDefintions = outputs;
            tmpErrors = new ErrorResultTO();
            tmpErrors.MergeErrors(_errorsTo);
            var result = ExecutePluginService(pluginServiceExecution, update);

            tmpErrors.MergeErrors(_errorsTo);
            return(result);
        }
예제 #23
0
        public EsbServiceInvoker(IEsbChannel esbChannel,
                                 IFrameworkDuplexDataChannel managementChannel,
                                 IWorkspace workspace, EsbExecuteRequest request)
        {
            _esbChannel = esbChannel;
            if (managementChannel != null)
            {
            }

            // 2012.10.17 - 5782: TWR - Added workspace parameter
            _workspace = workspace;

            _request = request;
        }
예제 #24
0
        public EsbServiceInvoker(IEsbChannel esbChannel,
                                      IFrameworkDuplexDataChannel managementChannel,
                                      IWorkspace workspace, EsbExecuteRequest request)
        {
            _esbChannel = esbChannel;
            if(managementChannel != null)
            {
            }

            // 2012.10.17 - 5782: TWR - Added workspace parameter
            _workspace = workspace;

            _request = request;
        }
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            tmpErrors = new ErrorResultTO();
            if (Namespace == null)
            {
                tmpErrors.AddError(ErrorResource.NoNamespaceSelected);
                return;
            }

            if (Constructor == null)
            {
                Constructor = new PluginConstructor();
            }

            ExecuteService(update, out tmpErrors, Constructor, Namespace, dataObject);
        }
예제 #26
0
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            tmpErrors = new ErrorResultTO();

            var(head, query, postData) = ConfigureHttp(dataObject, update);

            var url = ResourceCatalog.GetResource <WebSource>(Guid.Empty, SourceId);
            var webRequestResult = PerformWebPostRequest(head, query, url, postData);

            tmpErrors.MergeErrors(_errorsTo);

            ResponseManager = new ResponseManager {
                OutputDescription = OutputDescription, Outputs = Outputs, IsObject = IsObject, ObjectName = ObjectName
            };
            ResponseManager.PushResponseIntoEnvironment(webRequestResult, update, dataObject);
        }
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
        {
            tmpErrors = new ErrorResultTO();
            var webserviceExecution = GetNewWebserviceExecution(dataObject);


            if(webserviceExecution != null && !tmpErrors.HasErrors())
            {
                webserviceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
                webserviceExecution.InstanceInputDefinitions = inputs;
                ErrorResultTO invokeErrors;
                var result = webserviceExecution.Execute(out invokeErrors);
                dataObject.Environment.AddError(invokeErrors.MakeDataListReady());
                return result;
            }
            return Guid.NewGuid();
        }
예제 #28
0
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
        {
            tmpErrors = new ErrorResultTO();
            var webserviceExecution = GetNewWebserviceExecution(dataObject);


            if (webserviceExecution != null && !tmpErrors.HasErrors())
            {
                webserviceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
                webserviceExecution.InstanceInputDefinitions = inputs;
                ErrorResultTO invokeErrors;
                var           result = webserviceExecution.Execute(out invokeErrors);
                dataObject.Environment.AddError(invokeErrors.MakeDataListReady());
                return(result);
            }
            return(Guid.NewGuid());
        }
예제 #29
0
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO errors)
        {
            var execErrors = new ErrorResultTO();
            var compiler   = DataListFactory.CreateDataListCompiler();
            var oldID      = dataObject.DataListID;

            IList <KeyValuePair <enDev2ArgumentType, IList <IDev2Definition> > > remainingMappings = esbChannel.ShapeForSubRequest(dataObject, inputs, outputs, out errors);

            errors.MergeErrors(execErrors);

            var databaseServiceExecution = ServiceExecution as DatabaseServiceExecution;

            if (databaseServiceExecution != null)
            {
                databaseServiceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
            }

            var result = ServiceExecution.Execute(out execErrors);

            errors.MergeErrors(execErrors);

            // Adjust the remaining output mappings ;)
            compiler.SetParentID(dataObject.DataListID, oldID);

            if (remainingMappings != null)
            {
                var outputMappings = remainingMappings.FirstOrDefault(c => c.Key == enDev2ArgumentType.Output);
                compiler.Shape(dataObject.DataListID, enDev2ArgumentType.Output, outputMappings.Value, out execErrors);
                errors.MergeErrors(execErrors);
            }
            else
            {
                compiler.Shape(dataObject.DataListID, enDev2ArgumentType.DB_ForEach, outputs, out execErrors);
                errors.MergeErrors(execErrors);
            }

            compiler.ConvertFrom(dataObject.DataListID, DataListFormat.CreateFormat(GlobalConstants._XML_Without_SystemTags), enTranslationDepth.Data, out execErrors);
            errors.MergeErrors(execErrors);
            compiler.ConvertFrom(oldID, DataListFormat.CreateFormat(GlobalConstants._XML_Without_SystemTags), enTranslationDepth.Data, out execErrors);
            errors.MergeErrors(execErrors);

            return(result);
        }
예제 #30
0
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            _dataObject = dataObject;
            tmpErrors   = new ErrorResultTO();
            var webRequestResult = string.Empty;

            try
            {
                var(head, query, postData, conditions) = GetEnvironmentInputVariables(_dataObject.Environment, update);

                var source = ResourceCatalog.GetResource <WebSource>(Guid.Empty, SourceId);

                if (IsFormDataChecked)
                {
                    webRequestResult = PerformFormDataWebPostRequest(source, WebRequestMethod.Post, query, head, conditions);
                }
                else if (IsManualChecked)
                {
                    webRequestResult = PerformManualWebPostRequest(head, query, source, postData);
                }
            }
            catch (Exception ex)
            {
                tmpErrors.AddError(ex.Message);
            }
            finally
            {
                tmpErrors.MergeErrors(_errorsTo);

                var bytes    = webRequestResult.Base64StringToByteArray();
                var response = bytes.ReadToString();

                ResponseManager = new ResponseManager
                {
                    OutputDescription = OutputDescription,
                    Outputs           = Outputs,
                    IsObject          = IsObject,
                    ObjectName        = ObjectName
                };
                response = Scrubber.Scrub(response);
                ResponseManager.PushResponseIntoEnvironment(response, update, dataObject);
            }
        }
        protected override void ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
        {
            tmpErrors = new ErrorResultTO();
            var webserviceExecution = GetNewWebserviceExecution(dataObject);


            if (webserviceExecution != null && !tmpErrors.HasErrors())
            {
                webserviceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
                webserviceExecution.InstanceInputDefinitions = inputs;
                ErrorResultTO invokeErrors;
                webserviceExecution.Execute(out invokeErrors, update);
                string err = invokeErrors.MakeDataListReady();
                if (!string.IsNullOrEmpty(err))
                {
                    dataObject.Environment.AddError(err);
                }
            }
        }
 public InternalServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel, EsbExecuteRequest request)
     : base(sa, dataObj, theWorkspace, esbChannel, request)
 {
     var dataListTO = new DataListTO(sa.DataListSpecification.ToString());
     if(request.Args == null)
     {
         request.Args = new Dictionary<string, StringBuilder>();
         foreach(var input in dataListTO.Inputs)
         {
             var warewolfEvalResult = dataObj.Environment.Eval(DataListUtil.AddBracketsToValueIfNotExist(input),0,false);
             if(warewolfEvalResult.IsWarewolfAtomResult)
             {
                 var scalarResult = warewolfEvalResult as WarewolfDataEvaluationCommon.WarewolfEvalResult.WarewolfAtomResult;
                 if(scalarResult != null && !scalarResult.Item.IsNothing)
                 {
                     request.Args.Add(input, new StringBuilder(scalarResult.Item.ToString()));
                 }
             }
         }
     }
 }
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
        {
            _errorsTo = new ErrorResultTO();
            var compiler = DataListFactory.CreateDataListCompiler();

            ErrorResultTO invokeErrors;
            esbChannel.CorrectDataList(dataObject, dataObject.WorkspaceID, out invokeErrors, compiler);

            dataObject.DataListID = compiler.Shape(dataObject.DataListID, enDev2ArgumentType.Input, inputs, out invokeErrors);
            _errorsTo.MergeErrors(invokeErrors);

            _errorsTo.MergeErrors(invokeErrors);
            var pluginServiceExecution = GetNewPluginServiceExecution(dataObject);
            pluginServiceExecution.InstanceInputDefinitions = inputs;
            pluginServiceExecution.InstanceOutputDefintions = outputs;
            tmpErrors = new ErrorResultTO();
            tmpErrors.MergeErrors(_errorsTo);
            var result = ExecutePluginService(pluginServiceExecution);
            tmpErrors.MergeErrors(_errorsTo);
            return result;
        }
예제 #34
0
        protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
        {
            _errorsTo = new ErrorResultTO();
            var compiler = DataListFactory.CreateDataListCompiler();

            ErrorResultTO invokeErrors;

            esbChannel.CorrectDataList(dataObject, dataObject.WorkspaceID, out invokeErrors, compiler);

            dataObject.DataListID = compiler.Shape(dataObject.DataListID, enDev2ArgumentType.Input, inputs, out invokeErrors);
            _errorsTo.MergeErrors(invokeErrors);

            _errorsTo.MergeErrors(invokeErrors);
            var pluginServiceExecution = GetNewPluginServiceExecution(dataObject);

            tmpErrors = new ErrorResultTO();
            tmpErrors.MergeErrors(_errorsTo);
            var result = ExecutePluginService(pluginServiceExecution);

            tmpErrors.MergeErrors(_errorsTo);
            return(result);
        }
예제 #35
0
        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 (ServiceExecution is DatabaseServiceExecution databaseServiceExecution)
            {
                databaseServiceExecution.InstanceInputDefinitions = inputs;  // set the output mapping for the instance ;)
                databaseServiceExecution.InstanceOutputDefintions = outputs; // set the output mapping for the instance ;)
            }
            ServiceExecution.Execute(out execErrors, update);
            var fetchErrors = execErrors.FetchErrors();

            foreach (var error in fetchErrors)
            {
                dataObject.Environment.Errors.Add(error);
            }

            tmpErrors.MergeErrors(execErrors);
        }
 // ReSharper disable once TooManyDependencies
 public WebServiceContainerMock(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
 }
 public WebServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
     WebserviceExecution = new WebserviceExecution(dataObj, false);
 }
예제 #38
0
 public PluginServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
     _pluginServiceExecution = new PluginServiceExecution(dataObj, true);
 }
예제 #39
0
 public WebServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
     WebserviceExecution = new WebserviceExecution(dataObj, false);
 }
 public WfExecutionContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : this(sa, dataObj, theWorkspace, esbChannel, new WorkflowHelper())
 {
   
 }
        public InternalServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel, EsbExecuteRequest request)
            : base(sa, dataObj, theWorkspace, esbChannel, request)
        {

        }
 /// <summary>
 /// Need to add loc property to AbstractActivity ;)
 /// </summary>
 /// <param name="sa"></param>
 /// <param name="dataObj"></param>
 /// <param name="workspace"></param>
 /// <param name="esbChannel"></param>
 public RemoteWorkflowExecutionContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace workspace, IEsbChannel esbChannel)
     : this(sa, dataObj, workspace, esbChannel, ResourceCatalog.Instance)
 {
 }
 public DatabaseServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace workspace, IEsbChannel esbChannel)
     : base(sa, dataObj, workspace, esbChannel)
 {
     _databaseServiceExecution = new DatabaseServiceExecution(dataObj);
 }
 public void MockExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
 {
     ExecutionImpl(esbChannel, dataObject, inputs, outputs, out tmpErrors,0);
 }
예제 #45
0
 public PluginServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
     _pluginServiceExecution = new PluginServiceExecution(dataObj, true);
 }
 public Guid MockExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors)
 {
     return base.ExecutionImpl(esbChannel, dataObject, inputs, outputs, out tmpErrors);
 }
 public RemoteWorkflowExecutionContainerMock(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel, IResourceCatalog resourceCatalog)
     : base(sa, dataObj, theWorkspace, esbChannel, resourceCatalog)
 {
 }
예제 #48
0
        public EsbServiceInvoker(IEsbChannel esbChannel,
                                      IFrameworkDuplexDataChannel managementChannel,
                                      IWorkspace workspace)
            : this(esbChannel, managementChannel, workspace, null)
        {

        }
 protected EsbExecutionContainer(ServiceAction sa, IDSFDataObject dataObject, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : this(sa, dataObject, theWorkspace, esbChannel, null)
 {
 }
예제 #50
0
 // BUG 9304 - 2013.05.08 - TWR - Added IWorkflowHelper parameter to facilitate testing
 public WfExecutionContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
 }
예제 #51
0
 protected override Guid ExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int undate)
 {
     tmpErrors = new ErrorResultTO();
     tmpErrors.AddError("This is an error");
     return Guid.NewGuid();
 }
 public DatabaseServiceContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace workspace, IEsbChannel esbChannel)
     : base(sa, dataObj, workspace, esbChannel)
 {
     _databaseServiceExecution = new DatabaseServiceExecution(dataObj);
 }
 public void TestExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out ErrorResultTO tmpErrors, int update)
 {
     base.ExecutionImpl(esbChannel, dataObject, inputs, outputs, out tmpErrors, update);
 }
 public WebServiceContainerMockWithError(ServiceAction sa, IDSFDataObject dsfDataObject, IWorkspace workspace, IEsbChannel esbChannel)
     : base(sa, dsfDataObject, workspace, esbChannel)
 {
 }
 public System.Guid MockExecutionImpl(IEsbChannel esbChannel, IDSFDataObject dataObject, string inputs, string outputs, out DataList.Contract.ErrorResultTO tmpErrors)
 {
     return base.ExecutionImpl(esbChannel, dataObject, inputs, outputs, out tmpErrors);
 }
 // BUG 9304 - 2013.05.08 - TWR - Added IWorkflowHelper parameter to facilitate testing
 public WfExecutionContainer(ServiceAction sa, IDSFDataObject dataObj, IWorkspace theWorkspace, IEsbChannel esbChannel, IWorkflowHelper workflowHelper)
     : base(sa, dataObj, theWorkspace, esbChannel)
 {
     _workflowHelper = workflowHelper;
 }