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; }
/// <summary> /// Merges the errors. /// </summary> /// <param name="toMerge">To merge.</param> public void MergeErrors(ErrorResultTO toMerge) { if (toMerge != null && toMerge.HasErrors()) { // Flipping Union does not appear to work foreach (string wtf in toMerge.FetchErrors()) { _errorList.Add(wtf); } toMerge.ClearErrors(); } }
/// <summary> /// Creates the list of data list item view model to bind to. /// </summary> /// <param name="errorString">The error string.</param> /// <returns></returns> public void CreateListsOfIDataListItemModelToBindTo(out string errorString) { errorString = string.Empty; IDataListCompiler compiler = DataListFactory.CreateDataListCompiler(); if(!string.IsNullOrEmpty(Resource.DataList)) { ErrorResultTO errors = new ErrorResultTO(); try { IBinaryDataList binarnyDl = CreateBinaryDataListFromXmlData(Resource.DataList, out errors); if (!errors.HasErrors()) { ConvertBinaryDataListToListOfIDataListItemModels(binarnyDl, out errorString); } else { string errorMessage = errors.FetchErrors().Aggregate(string.Empty, (current, error) => current + error); throw new Exception(errorMessage); } if (binarnyDl != null) compiler.ForceDeleteDataListByID(binarnyDl.UID); } catch(Exception) { errors.AddError("Invalid variable list. Please insure that your variable list has valid entries"); } } else { RecsetCollection.Clear(); AddRecordSet(); ScalarCollection.Clear(); } BaseCollection = new OptomizedObservableCollection<DataListHeaderItemModel>(); DataListHeaderItemModel varNode = DataListItemModelFactory.CreateDataListHeaderItem("Variable"); if(ScalarCollection.Count == 0) { var dataListItemModel = DataListItemModelFactory.CreateDataListModel(string.Empty); ScalarCollection.Add(dataListItemModel); } varNode.Children = ScalarCollection; BaseCollection.Add(varNode); //AddRecordsetNamesIfMissing(); DataListHeaderItemModel recordsetsNode = DataListItemModelFactory.CreateDataListHeaderItem("Recordset"); if(RecsetCollection.Count == 0) { AddRecordSet(); } recordsetsNode.Children = RecsetCollection; BaseCollection.Add(recordsetsNode); }