====== DSE / Data Query / Calculation ====== ===== Map transformation of a list ===== The generate is configured as follow : * Generator strategy : Iterate Over List Strategy * List Expression : [ {matiere:"ABS", min:0.9, max:1, average:1}, {matiere:"Aluminium LME", min:0.5, max:1, average:0.95}, {matiere:"Aluminium MB", min:0.5, max:1, average:0.95}, {matiere:"Cobalt", min:0.95, max:1, average:1}, {matiere:"Copper - LME", min:0.9, max:1, average:1}, {matiere:"Copper - LME (Harness indexation)", min:0.9, max:1, average:1}, {matiere:"EPDM", min:0.9, max:1, average:1}, {matiere:"Flat Steel", min:0.19, max:0.90, average:0.64}, {matiere:"HDPE", min:0.9, max:1, average:1}, {matiere:"Lead", min:0.95, max:1, average:1}, {matiere:"Lithium", min:0.95, max:1, average:1}, {matiere:"Lithium HO", min:0.95, max:1, average:1}, {matiere:"Long steel", min:0.60, max:1, average:0.85}, {matiere:"Nickel", min:0.95, max:1, average:1}, {matiere:"Manganese", min:0.95, max:1, average:1}, {matiere:"Out Of RMCC Scope", min:0.95, max:1, average:1}, {matiere:"PA", min:0.9, max:1, average:1}, {matiere:"Paint", min:0.9, max:1, average:1}, {matiere:"Palladium", min:0.95, max:1, average:1}, {matiere:"Platinum", min:0.95, max:1, average:1}, {matiere:"PU", min:0.90, max:1, average:1}, {matiere:"Rhodium", min:0.95, max:1, average:1}, {matiere:"Scrapp (Cast Iron)", min:0.6, max:1, average:0.85}, {matiere:"Stainless Steel", min:0.6, max:1, average:0.85}, {matiere:"Tire", min:0.9, max:1, average:1}, {matiere:"Virgin filled PP", min:0.9, max:1, average:1}, {matiere:"Virgin unfilled PP", min:0.9, max:1, average:1}, {matiere:"Natural Rubber (Tires excluded)", min:0.90, max:1, average:1}, {matiere:"Synthetics Rubber (Tires excluded)", min:0.90, max:1, average:1}, {matiere:"Zinc", min:0.95, max:1, average:1} ] The generator pushes into variable : yield_ratio_list In a 'Map' component, the @yield_ratio_list variable is transformed as a map variable : /* Map yield ratio threshold data */ yield_ratio_threshold: Map> = @yield_ratio_list.toMap(keyFunction: x => x.matiere, valueFunction: x => x); This new map variable is used the following way : { part:input.part , final_material_weight_net: evaluated_net_weight , final_material_weight_net_source :input.final_material_weight_net_source , final_material_weight_gross: evaluated_net_weight IS NULL ? evaluated_gross_weight : yield_ratio>=yield_ratio_threshold[input.rm_name].min AND yield_ratio<=yield_ratio_threshold[input.rm_name].max ? evaluated_gross_weight : evaluated_net_weight / yield_ratio_threshold[input.rm_name].average }