Forum Discussion
FICO
13 years agoCommunity Manager
Setting Node Value for ClassProperties ValueHolder
Setting Node Value for ClassProperties ValueHolder
I am trying to assign value of class property to the ClassProperty ValueHolder( Type of Class Properties Provider) by using ROM API using below scipt.
setNodeValue("vhRuleSet.vhRule[3].vhCode.classPropertiesVH","condition");
// Actual function
protected void setNodeValue(String path, String value) throws NdRMAException
{
NdInstanceElementNode valueNode = rmaRuleSetInstance.lookupInstanceElementNode(
NdAbstractInstanceNode.INSTANCE_SECTION_INSTANTIATION, path, false);
rmaRuleSetInstance.setNodeValue(valueNode, value);
}
where "condition" is the class property and vhRuleSet, vhRule[3] ,vhCode, classPropertiesVH are the nodes. (With Static Override of Class is already provided in the template).
But the above script is not working i.e the value is not getting assigned to node.
But for String or Integer Provider I am able to assign the value.
Please let me know any alternative or cause for it.
1 Reply
- FICOCommunity Manager
Make sure the value you try to assign is actually available to that node when you try to assign it. Try extracting the NdInstantiationElement for the node you are modifying, and invoke its "getAllowedInstantiationValues()" method. The value you want to set needs to be in that array, or you will receive a validation error.
HTH,
Jostein
