Esempio n. 1
0
        private DecisionMetadata CompileMockDecision(string decisionCode)
        {
            DecisionMetadata decisionMetadata = new DecisionMetadata("Decision");

            decisionMetadata.DecisionCode = decisionCode;

            DecisionCompilationRunner_Accessor.BuildSourceAndCompileDecisionModule(decisionMetadata, null, null,
                                                                                   AppContext.WorkspaceInstance.TypeDirectories, new LoggerNameRoot("Mock"));

            AppContext.DecisionsToClear.Add(decisionMetadata.UniqueDecisionID);

            return(decisionMetadata);
        }
Esempio n. 2
0
        private void CompileLoopDecision(string code)
        {
            //constuct mock loop metadata - subgraph does not matter in code compilation
            LoopScopeMetadata mockLoopMetadata = new LoopScopeMetadata(null, "Mock loop", String.Empty);

            Dictionary <string, string> mockSuccessorNodeLabelIdLookup = new Dictionary <string, string>();

            Dictionary <string, string> mockPredeccessorsOutputsNameTypeLookup = new Dictionary <string, string>();

            mockPredeccessorsOutputsNameTypeLookup.Add("test", "int");

            mockLoopMetadata.DecisionCode = code;

            DecisionCompilationRunner_Accessor.BuildSourceAndCompileDecisionModule(mockLoopMetadata, mockSuccessorNodeLabelIdLookup, mockPredeccessorsOutputsNameTypeLookup,
                                                                                   AppContext.WorkspaceInstance.TypeDirectories, new LoggerNameRoot("Mock"));
        }
Esempio n. 3
0
        private void CompileDecision(string code)
        {
            DecisionMetadata decisionMetadata = new DecisionMetadata("Decision");

            Dictionary <string, string> mockSuccessorNodeLabelIdLookup = new Dictionary <string, string>();

            mockSuccessorNodeLabelIdLookup.Add("node 1 label", "Fake node 1 id");
            mockSuccessorNodeLabelIdLookup.Add("node 2 label", "Fake node 2 id");

            Dictionary <string, string> mockPredeccessorsOutputsNameTypeLookup = new Dictionary <string, string>();

            mockPredeccessorsOutputsNameTypeLookup.Add("test", "int");
            mockPredeccessorsOutputsNameTypeLookup.Add("targetArtifacts", "TraceLabSDK.Types.TLArtifactsCollection");
            mockPredeccessorsOutputsNameTypeLookup.Add("sourceArtifacts", "TraceLabSDK.Types.TLArtifactsCollection");

            decisionMetadata.DecisionCode = code;

            DecisionCompilationRunner_Accessor.BuildSourceAndCompileDecisionModule(decisionMetadata, mockSuccessorNodeLabelIdLookup, mockPredeccessorsOutputsNameTypeLookup,
                                                                                   AppContext.WorkspaceInstance.TypeDirectories, new LoggerNameRoot("Mock"));
        }