public override Object HandleValue(PipelineContext ctx, String key, Object value)
        {
            value = ConvertAndCallScript(ctx, key, value);
            if ((ctx.ActionFlags & _ActionFlags.Skip) != 0)
            {
                goto EXIT_RTN;
            }

            //if (endPoint.GetFieldAsStr("doc_cat") == "delete") Debugger.Break();

            bool matched = cond.NeedRecord ? cond.HasCondition((JObject)endPoint.GetField(null)) : cond.HasCondition(value.ToJToken());

            if (subActions != null)
            {
                if (matched)
                {
                    return(subActions[0].HandleValue(ctx, key, value));
                }
                else
                if (subActions.Length > 1)
                {
                    return(subActions[1].HandleValue(ctx, key, value));
                }
                return(null);
            }

            if (matched)
            {
                if (skipUntil == null)
                {
                    ctx.ClearAllAndSetFlags(_ActionFlags.ConditionMatched);
                }
                else
                {
                    ctx.Skipped++;
                    ctx.ClearAllAndSetFlags(_ActionFlags.SkipRest, genericSkipUntil ? Name : skipUntil);
                }
            }

EXIT_RTN:
            return(value);
        }
Esempio n. 2
0
        public override Object HandleValue(PipelineContext ctx, String key, Object value)
        {
            value = ConvertAndCallScript(ctx, key, value);
            if ((ctx.ActionFlags & _ActionFlags.Skip) != 0)
            {
                goto EXIT_RTN;
            }

            if (cond == null || (cond.NeedRecord ? cond.HasCondition((JObject)endPoint.GetField(null)) : cond.HasCondition(value.ToJToken())))
            {
                ctx.Skipped++;
                ctx.ClearAllAndSetFlags(_ActionFlags.SkipRest, genericSkipUntil ? Name : skipUntil);
                if (keySource != null)
                {
                    String k = keySource.GetKey(ctx, value);
                    if (k != null)
                    {
                        endPoint.Delete(ctx, k);
                    }
                }
            }
EXIT_RTN:
            return(value);
        }