I have a case where I have n number of chainbuilders ,lets say n1, n2 etc . I want to execute them based on object property and result of primary chainbuilder
e.g. lets say , each chainbuilder refers to an action executed. My primary action is a1
I have a class Toy [name : String, propMap]
case class propMap(shopName: String, colorNPrice: List[Map[String, Integer]])
I want that my simulation should first check if a1 has a certain response code and if that’s true , then foreach object instance of Toy , it should execute either of (n1,n2…) based on price point (present in colorNPrice list).
I am able to execute a1 and check the condition for that.
I am struggling to find proper dsl for executing actions with foreach applied on class object particularly as one quoted.
Please help in case you know anything here.