private Value ProcessSelect(LogicalQueryOperationValue operand, Value annotation, LocalCodeExecutionContext localCodeExecutionContext)
        {
#if DEBUG
            //Log($"operand = {operand}");
            //Log($"annotation = {annotation}");
#endif

            if (operand.Target == null)
            {
                throw new NotImplementedException();
            }

            if (operand.Source != null)
            {
                throw new NotImplementedException();
            }

            if (operand.Dest != null)
            {
                throw new NotImplementedException();
            }

            var target = operand.Target;

            if (!target.IsRuleInstanceValue)
            {
                throw new NotImplementedException();
            }

            var query = target.AsRuleInstanceValue.RuleInstance;

#if DEBUG
            //Log($"query = {query}");
            //Log($"query = {DebugHelperForRuleInstance.ToString(query)}");
#endif

            var searchOptions = new LogicalSearchOptions();
            searchOptions.QueryExpression           = query;
            searchOptions.LocalCodeExecutionContext = localCodeExecutionContext;

#if DEBUG
            //Log($"searchOptions = {searchOptions}");
#endif

            var searchResult = _searcher.Run(searchOptions);

#if DEBUG
            //Log($"searchResult = {searchResult}");
            //Log($"result = {DebugHelperForLogicalSearchResult.ToString(searchResult, _engineContext.Dictionary)}");
#endif

            return(new LogicalSearchResultValue(searchResult));
        }
        private Value ProcessInsert(LogicalQueryOperationValue operand, Value annotation, LocalCodeExecutionContext localCodeExecutionContext)
        {
#if DEBUG
            //Log($"operand = {operand}");
            //Log($"annotation = {annotation}");
#endif

            if (operand.Target == null)
            {
                throw new NotImplementedException();
            }

            if (operand.Source != null)
            {
                throw new NotImplementedException();
            }

            if (operand.Dest != null)
            {
                throw new NotImplementedException();
            }

            var target = operand.Target;

            if (!target.IsRuleInstanceValue)
            {
                throw new NotImplementedException();
            }

            var ruleInstance = target.AsRuleInstanceValue.RuleInstance;

#if DEBUG
            //Log($"ruleInstance = {DebugHelperForRuleInstance.ToString(ruleInstance)}");
#endif

            _logicalStorage.Append(ruleInstance);

            return(target);
        }
Beispiel #3
0
 /// <inheritdoc/>
 protected override void OnEnter()
 {
     Result = new LogicalQueryOperationValue();
 }