Esempio n. 1
0
        private PatternValidatedDesc ValidatePatternContextConditionPattern(
            bool isStartCondition,
            int nestingLevel,
            ContextSpecConditionPattern pattern,
            ISet<string> eventTypesReferenced,
            MatchEventSpec priorMatches,
            ISet<string> priorAllTags,
            CreateContextValidationEnv validationEnv)
        {
            var raw = new PatternStreamSpecRaw(
                pattern.PatternRaw,
                ViewSpec.EMPTY_VIEWSPEC_ARRAY,
                null,
                StreamSpecOptions.DEFAULT,
                false,
                false);
            var compiledDesc = StreamSpecCompiler.CompilePatternWTags(
                raw,
                eventTypesReferenced,
                false,
                priorMatches,
                priorAllTags,
                false,
                true,
                false,
                0,
                validationEnv.StatementRawInfo,
                validationEnv.Services);
            var compiled = (PatternStreamSpecCompiled) compiledDesc.StreamSpecCompiled;

            pattern.PatternCompiled = compiled;
            pattern.PatternContext = new PatternContext(
                0,
                compiled.MatchedEventMapMeta,
                true,
                nestingLevel,
                isStartCondition);

            var forges = compiled.Root.CollectFactories();
            foreach (var forge in forges) {
                forge.CollectSelfFilterAndSchedule(
                    validationEnv.FilterSpecCompileds,
                    validationEnv.ScheduleHandleCallbackProviders);
            }

            var spec = new MatchEventSpec(compiled.TaggedEventTypes, compiled.ArrayEventTypes);
            return new PatternValidatedDesc(spec, compiled.AllTags, compiledDesc.AdditionalForgeables);
        }