/// <summary> /// Generates the invoke container. /// </summary> /// <param name="dataObject">The data object.</param> /// <param name="serviceName">Name of the service.</param> /// <param name="isLocalInvoke">if set to <c>true</c> [is local invoke].</param> /// <param name="masterDataListId">The master data list unique identifier.</param> /// <returns></returns> public EsbExecutionContainer GenerateInvokeContainer(IDSFDataObject dataObject, String serviceName, bool isLocalInvoke, Guid masterDataListId = default(Guid)) { if (isLocalInvoke) { ServiceLocator sl = new ServiceLocator(); var resourceId = dataObject.ResourceID; DynamicService theService = GetService(serviceName, resourceId, sl); EsbExecutionContainer executionContainer = null; if (theService != null && theService.Actions.Any()) { var sa = theService.Actions.FirstOrDefault(); MapServiceActionDependencies(sa, sl); executionContainer = GenerateContainer(sa, dataObject, _workspace); } return(executionContainer); } // we need a remote container ;) // TODO : Set Output description for shaping ;) return(GenerateContainer(new ServiceAction { ActionType = Common.Interfaces.Core.DynamicServices.enActionType.RemoteService }, dataObject, null)); }
static void SetRemoteExecutionDataList(IDSFDataObject dataObject, EsbExecutionContainer executionContainer) { var remoteContainer = executionContainer as RemoteWorkflowExecutionContainer; if (remoteContainer != null) { var fetchRemoteResource = remoteContainer.FetchRemoteResource(dataObject.ServiceName); if (fetchRemoteResource != null) { fetchRemoteResource.DataList = fetchRemoteResource.DataList.Replace(GlobalConstants.SerializableResourceQuote, "\"").Replace(GlobalConstants.SerializableResourceSingleQuote, "'"); var remoteDataList = fetchRemoteResource.DataList; dataObject.RemoteInvokeResultShape = new StringBuilder(remoteDataList); } } }
static void SetRemoteExecutionDataList(IDSFDataObject dataObject, EsbExecutionContainer executionContainer, ErrorResultTO errors) { var remoteContainer = executionContainer as RemoteWorkflowExecutionContainer; if (remoteContainer != null) { var fetchRemoteResource = remoteContainer.FetchRemoteResource(dataObject.ResourceID, dataObject.ServiceName, dataObject.IsDebugMode()); if (fetchRemoteResource != null) { fetchRemoteResource.DataList = fetchRemoteResource.DataList.Replace(GlobalConstants.SerializableResourceQuote, "\"").Replace(GlobalConstants.SerializableResourceSingleQuote, "'"); var remoteDataList = fetchRemoteResource.DataList; dataObject.RemoteInvokeResultShape = new StringBuilder(remoteDataList); dataObject.ServiceName = fetchRemoteResource.ResourceCategory; } else { var message = string.Format("Remote Execution Failed. Service: {0} not found.", dataObject.ServiceName); errors.AddError(message); } } }
private EsbExecutionContainer GenerateContainer(ServiceAction serviceAction, IDSFDataObject dataObj, IWorkspace theWorkspace) { // set the ID for later use ;) dataObj.WorkspaceID = _workspace.ID; EsbExecutionContainer result = null; switch (serviceAction.ActionType) { case Common.Interfaces.Core.DynamicServices.enActionType.InvokeManagementDynamicService: result = new InternalServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel, _request); break; case Common.Interfaces.Core.DynamicServices.enActionType.InvokeStoredProc: result = new DatabaseServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel); break; case Common.Interfaces.Core.DynamicServices.enActionType.InvokeWebService: result = new WebServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel); break; case Common.Interfaces.Core.DynamicServices.enActionType.Plugin: result = new PluginServiceContainer(serviceAction, dataObj, theWorkspace, _esbChannel); break; case Common.Interfaces.Core.DynamicServices.enActionType.Workflow: result = new WfExecutionContainer(serviceAction, dataObj, theWorkspace, _esbChannel); break; case Common.Interfaces.Core.DynamicServices.enActionType.RemoteService: result = new RemoteWorkflowExecutionContainer(serviceAction, dataObj, null, _esbChannel); break; } return(result); }