private ProcessDefinition ExtractProcessFromCompiledSource(Compilation compilation, string processName) { var w = new Walk(); var processType = w.Visit(compilation.SourceModule.GlobalNamespace); if (!processType.Any()) return null; INamedTypeSymbol processSymbol = null; if (string.IsNullOrWhiteSpace(processName)) { processSymbol = processType.FirstOrDefault(x => x.Interfaces.Any(i => i.Name == ProcessIfxName)); } else { processSymbol = processType.FirstOrDefault(x => x.Name.Contains(processName) && x.Interfaces.Any(i => i.Name == ProcessIfxName)); } if (processSymbol == null) return null; var p = new ProcessDefinition(processSymbol, ProcessIfxName); p.SetStateEnumUsingStrategy(defaultStateDiscoveryStrategy); return p; }
public static MilToken GetTokenFromDefinition(ProcessDefinition definition) { return((definition == null || !definition.IsDefinitionComplete) ? TokenFactory.GetStatementTerminator() : TokenFactory.GetStateDefinition(definition.ProcessName, definition.StateProperty.Name, definition.StateEnum.MemberNames)); }
public static MilToken GetTokenFromDefinition(ProcessDefinition definition) { return (definition == null || !definition.IsDefinitionComplete) ? TokenFactory.GetStatementTerminator() : TokenFactory.GetStateDefinition(definition.ProcessName, definition.StateProperty.Name, definition.StateEnum.MemberNames); }