示例#1
0
        public void Execute(IProcessingContext processingContext, ITransactionScopeContext transactionScopeContext)
        {
            KraftModule   loadedModule  = _KraftModuleCollection.GetModule(processingContext.InputModel.Module);
            LoadedNodeSet loadedNodeSet = _NodesSetService.LoadNodeSet(
                processingContext.InputModel.Module,
                processingContext.InputModel.NodeSet,
                processingContext.InputModel.Nodepath);
            StringBuilder sb;

            if (!CheckValidity(processingContext, loadedModule, loadedNodeSet, out sb))
            {
                PluginAccessorImp <IDataLoaderPlugin> externalService = new PluginAccessorImp <IDataLoaderPlugin>(transactionScopeContext, loadedModule.ModuleSettings);
                PluginAccessorImp <INodePlugin>       customService   = new PluginAccessorImp <INodePlugin>(transactionScopeContext, loadedModule.ModuleSettings);
                INodeTaskExecutor taskExecutor = new NodeTaskExecutor(transactionScopeContext, loadedModule.ModuleSettings);
                taskExecutor.Execute(loadedNodeSet, processingContext, externalService, customService);
            }
            else
            {
                processingContext.ReturnModel.Status.IsSuccessful = false;
                processingContext.ReturnModel.Status.StatusResults.Add(new StatusResult()
                {
                    Message = sb.ToString(), StatusResultType = SysPlugins.Interfaces.Packet.StatusResultEnum.EStatusResult.StatusResultError
                });
            }
        }
示例#2
0
        private static ModuleSignalDetails GenerateDetails(string moduleKey, KraftModuleSignal kraftModuleSignal, INodeSetService nodeSetService)
        {
            ModuleSignalDetails moduleSignalDetails = new ModuleSignalDetails();
            LoadedNodeSet       nodeSet             = nodeSetService.LoadNodeSet(moduleKey, kraftModuleSignal.NodeSet, kraftModuleSignal.NodePath);

            if (nodeSet.StartNode.Read != null)
            {
                moduleSignalDetails.Read            = nodeSet.StartNode.Read;
                moduleSignalDetails.Read.Parameters = nodeSet.StartNode.Parameters;
                //moduleSignalDetails.InitRead();
            }
            if (nodeSet.StartNode.Write != null)
            {
                moduleSignalDetails.Write            = nodeSet.StartNode.Write;
                moduleSignalDetails.Write.Parameters = nodeSet.StartNode.Parameters;
                //moduleSignalDetails.InitWrite();
            }
            return(moduleSignalDetails);
        }