public override void ExecuteInternal(ValueTransitContext ctx)
 {
     if (ConditionIsTrue(ctx))
     {
         var value = Replace(ctx);
         ctx.SetCurrentValue(value);
         ctx.Flow = Important ? TransitionFlow.SkipValue : TransitionFlow.Continue;
     }
 }
        public override void ExecuteInternal(ValueTransitContext ctx)
        {
            Init();
            var  value            = ctx.TransitValue;
            char decimalSeparator = DecimalSeparator == 0 ? MapConfig.Current.DefaultDecimalSeparator : DecimalSeparator;

            try
            {
                var typedValue = TypeConverter.GetTypedValue(_typeCode, value, decimalSeparator, Format);
                ctx.SetCurrentValue(typedValue);
            }
            catch (Exception e)
            {
                if (OnError == null)
                {
                    throw;
                }

                ctx.Execute(OnError);
            }
        }
        public override void ExecuteInternal(ValueTransitContext ctx)
        {
            object lookupObject = null;

            var valueToFind = ctx.TransitValue?.ToString();

            if (valueToFind.IsNotEmpty())
            {
                lookupObject = FindLookupObject(valueToFind, ctx);

                if (lookupObject == null)
                {
                    if (TraceNotFound)
                    {
                        string message = $"Lookup ({Source}) object not found by value '{valueToFind}'\nSource row: { ctx.Source.RowNumber}, Source key: {ctx.Source.Key}";
                        Migrator.Current.Tracer.TraceEvent(MigrationEvent.LookupFailed, ctx, message);
                    }

                    ctx.Execute(OnNotFound);
                }
            }

            ctx.SetCurrentValue(lookupObject);
        }
Пример #4
0
        public override void ExecuteInternal(ValueTransitContext ctx)
        {
            var returnValue = Expression.Evaluate(ctx);

            ctx.SetCurrentValue(returnValue);
        }
        public override void ExecuteInternal(ValueTransitContext ctx)
        {
            string result = Commands.Select(i => ctx.Execute(i)?.ToString()).Join("/");

            ctx.SetCurrentValue(result);
        }