I'm trying to find a way to loop through all the attributes in a given ruleset. Is this possible?
I've found the "Attributes" collection which, according to the Infor CPQ Design Studio Reference Guide - Cloud Edition, is a read-write collection that contains all persisted component attributes and is probably what I need. The collection is structured as component attribute name and value pairs.
I have a For Each rule (ID: 849) but when attempting to loop through the Attributes collection I get an error "For Each Rule Collection variable must evaluate to a Collection".
So I made a variable rule (ID: 853) and placed it as a parent of the For Each rule. In that variable rule I'm evaluating some expressions to check if the Attributes collection is really a collection, see if a key exists in the collection, and count the number of elements. They all work which indicates that the Attributes collection is a collection, it has a known key, and it has some number of elements (27 in this case).
So why am I receiving an error?
Also, is there any additional documentation besides the "Infor CPQ Design Studio Reference Guide - Cloud Edition"? I'm using the Release 2025.x PDF from October 1, 2025 but I would like more in depth documentation if available.
Ruleset: MyNamespace.MyRuleset.D.BuyDesign.en-US Rule: 853 Sanity Check (Ruleset: MyNamespace.MyRuleset.D.BuyDesign.en-US)
VariableRule
Condition Expression :
Condition Result : True
Number of assignments: 3
Variable : CheckCollection
Assignment : =IsCollection(Attributes)
Trace : IsCollection({Plate : False, Capacity : "25", cAttributes : {}, CfgDescription : null, ConfigurationCode : null, ConfiguredPrice : null, CSI_BackgroundJobCreation : null, Edge : False, Width : "66", DiscountPercent : null, DocumentLink : null, EffectiveDate : null, EQ_ConfigurationApproverComment : null, EQ_ConfigurationRequesterComment : null, EQ_IsConfigurationApproved : null, EQ_RequiresConfigurationApproval : null, ExpirationDate : null, ImageLink : null, Length : "27", QueuePostConfiguration : null, QueueType : null, Extras : False, Height : null, RenewalDate : null, OptionA : False, SyteLine_Hold : null, Type : "Manual"})
Previous : (unassigned)
Result : True
Variable : DoesKeyExist
Assignment : =ContainsCollectionKey(Attributes, "Capacity")
Trace : ContainsCollectionKey({Plate : False, Capacity : "25", cAttributes : {}, CfgDescription : null, ConfigurationCode : null, ConfiguredPrice : null, CSI_BackgroundJobCreation : null, Edge : False, Width : "66", DiscountPercent : null, DocumentLink : null, EffectiveDate : null, EQ_ConfigurationApproverComment : null, EQ_ConfigurationRequesterComment : null, EQ_IsConfigurationApproved : null, EQ_RequiresConfigurationApproval : null, ExpirationDate : null, ImageLink : null, Length : "27", QueuePostConfiguration : null, QueueType : null, Extras : False, Height : null, RenewalDate : null, OptionA : False, SyteLine_Hold : null, Type : "Manual"}, "Capacity")
Previous : (unassigned)
Result : True
Variable : NumElements
Assignment : =ElementCount(Attributes)
Trace : ElementCount({ collection with 27 elements })
Previous : (unassigned)
Result : 27
--------------------------------------------------------------------------------
Ruleset: MyNamespace.MyRuleset.D.BuyDesign.en-US Rule: 849 Loop through Attributes Collection (Ruleset: MyNamespace.MyRuleset.D.BuyDesign.en-US)
ForEachRule
Condition Expression :
Condition Result : True
Execution error:
For Each Rule Collection variable must evaluate to a Collection
Active rule: 849 Loop through Attributes Collection (Ruleset: MyNamespace.MyRuleset.D.BuyDesign.en-US)
Active component: MyNamespace·MyRuleset