@@ -122,13 +122,13 @@ func (ctx *Context) Configure(cfg Config) error {
122122 switch {
123123 case cfg .XMLCallback :
124124 over .MDC ().Set ("context" , "callback-input" )
125- ctx .source = model .NewCallableMapSource ()
125+ ctx .source = model .NewMutableSource ()
126126 case cfg .EmptyInput :
127127 over .MDC ().Set ("context" , "empty-input" )
128- ctx .source = model .NewSourceFromSlice ([]model.Dictionary {model .NewPackedDictionary ()})
128+ ctx .source = model .NewSliceSource ([]model.Dictionary {model .NewPackedDictionary ()})
129129 case cfg .SingleInput != nil :
130130 over .MDC ().Set ("context" , "single-input" )
131- ctx .source = model .NewSourceFromSlice ([]model.Dictionary {cfg .SingleInput .Pack ()})
131+ ctx .source = model .NewSliceSource ([]model.Dictionary {cfg .SingleInput .Pack ()})
132132 case cfg .ParquetInput != "" :
133133 over .MDC ().Set ("context" , "parquet" )
134134 source , err := parquet .NewPackedSource (cfg .ParquetInput )
@@ -145,6 +145,10 @@ func (ctx *Context) Configure(cfg Config) error {
145145 return fmt .Errorf ("Cannot use repeatUntil and repeatWhile options together" )
146146 }
147147
148+ if cfg .Iteration > 1 {
149+ ctx .source = model .NewCountRepeater (ctx .source , cfg .Iteration )
150+ }
151+
148152 ctx .repeatCondition = cfg .RepeatWhile
149153 ctx .repeatConditionMode = "while"
150154 if cfg .RepeatUntil != "" {
@@ -153,8 +157,8 @@ func (ctx *Context) Configure(cfg Config) error {
153157 }
154158
155159 ctx .pipeline = model .NewPipeline (ctx .source ).
156- Process (model .NewCounterProcessWithCallback ("input-line" , 0 , updateContext )).
157- Process ( model . NewRepeaterProcess ( cfg . Iteration ))
160+ Process (model .NewCounterProcessWithCallback ("input-line" , 0 , updateContext ))
161+
158162 over .AddGlobalFields ("input-line" )
159163
160164 injectTemplateFuncs ()
@@ -399,11 +403,11 @@ func (ctx *Context) ExecuteMap(data map[string]any) (map[string]any, error) {
399403 for k , v := range data {
400404 input = input .With (k , v )
401405 }
402- source , ok := ctx .source .(* model.CallableMapSource )
406+ source , ok := ctx .source .(* model.MutableSource )
403407 if ! ok {
404- return nil , fmt .Errorf ("Source is not CallableMapSource " )
408+ return nil , fmt .Errorf ("Source is not MutableSource " )
405409 }
406- source .SetValue (input )
410+ source .SetValues (input )
407411 result := []model.Entry {}
408412 err := ctx .pipeline .AddSink (model .NewSinkToSlice (& result )).Run ()
409413 if err != nil {
0 commit comments