I need advice on how to create a rule that has: instantiated models that contribute to a total and then based on that total, we are calling out kits.
The rule requirement is: If the total system (model) amperage is > 12, then call out cooling kit A. If the total system amperage is < 12, call out cooling kit B.
Model 1 (PTO Model)
Model 1a (ATO Model)
Model 1b (ATO Model)
Model 1c (ATO Model)
Each of the ATO models above have a property called 'Amps'. We store the amperage of each of these ATO models in this property. As the model is configured, we add this property 'Amperage' to a Total on the PTO model. Then, based on this total, we call out cooling kits.
My issue is that I cannot get the optional instantiated models to contribute to a total unless all the models are selected (almost acting like an 'alltrue'). I just want that every time a module/model is added to a configuration, that it adds to a 'total amperage' bucket. Once done configuring, then based on this bucket total, call out a kit.
Any one have any experience or encounter the same need?
Thanks in advance,
Can you share the CDL you are trying?
I am thinking something like this should work:
Contribute 'Model 1a'.State() * 'Model 1'.Property("Amps") to 'Amp-Total';
Contribute 'Model 1b'.State() * 'Model 1'.Property("Amps") to 'Amp-Total';
Contribute 'Model 1c'.State() * 'Model 1'.Property("Amps") to 'Amp-Total';
Contribute 1 * AnyTrue('Amp-Total'>12) to 'Cooling Kit A';
Contribute 1 * AnyTrue('Amp-Total'<12) to 'Cooling Kit B';