@@ -14,10 +14,10 @@ def self.Each(block_activity=nil, dataset_from: nil, item_key: :item, id: Macro.
1414 # filter to set ctx[:index]
1515 # The interesting part here is that we read dynamic values from the {circuit_options}, to not
1616 # pollute the business ctx.
17- my_lowlevel_inject_filter = -> ( ( ctx , flow_options ) , index :, **circuit_options ) { [ index , ctx ] }
17+ my_lowlevel_inject_filter = -> ( ( ctx , flow_options ) , index :, **circuit_options ) { [ { index : index } , ctx ] }
1818 my_filter_builder = -> ( *) { Trailblazer ::Activity ::DSL ::Linear ::VariableMapping ::SetVariable . new ( name : "bla.FIXME" , filter : my_lowlevel_inject_filter , write_name : :index , user_filter : nil ) }
1919 # filter to set ctx[item_key]
20- my_lowlevel_inject_filter_item = -> ( ( ctx , flow_options ) , item :, **circuit_options ) { [ item , ctx ] }
20+ my_lowlevel_inject_filter_item = -> ( ( ctx , flow_options ) , item :, **circuit_options ) { [ { item_key => item } , ctx ] }
2121 my_filter_builder_item = -> ( *) { Trailblazer ::Activity ::DSL ::Linear ::VariableMapping ::SetVariable . new ( name : "bla.FIXME.item_key" , filter : my_lowlevel_inject_filter_item , write_name : item_key , user_filter : nil ) }
2222
2323 # DISCUSS: move to Wrap.
@@ -121,7 +121,7 @@ def self.options_for_dataset_from(dataset_from:)
121121 def self . compute_runtime_id ( ctx , trace_node :, activity :, compile_id :, **)
122122 # activity is the iterated activity
123123 fields = activity . to_h [ :fields ]
124- return compile_id unless fields && fields [ :each ] == true
124+ return unless fields && fields [ :each ] == true
125125
126126 # Developer::Trace::Snapshot::Ctx.ctx_snapshot_for(trace_node.snapshot_before, .data
127127# FIXME: BETTER API, we need access to stack now
@@ -130,7 +130,7 @@ def self.compute_runtime_id(ctx, trace_node:, activity:, compile_id:, **)
130130 # index = trace_node.snapshot_before.data[:ctx_snapshot].fetch(:index)
131131 index = trace_node . snapshot_before . data [ :ctx_variable_changeset ] . find { |name , version , value | name == :index } [ 2 ]
132132
133- ctx [ : runtime_id] = "#{ compile_id } .#{ index } "
133+ ctx . merge ( runtime_id : "#{ compile_id } .#{ index } " )
134134 end
135135 end
136136 end
0 commit comments