* @param value the entity into which the new entities for the given path should be inserted
* @param choicePath the path of choice attributes
*/
public void createNestedEntitiesForChoicePath(I_Entity value, List<String> choicePath) {
I_Entity parentValue = value;
for (String attributeChoice : choicePath) {
I_Type choiceType = m_vie.getType(parentValue.getTypeName()).getAttributeType(Type.CHOICE_ATTRIBUTE_NAME);
I_Entity choice = m_vie.createEntity(null, choiceType.getId());
parentValue.addAttributeValue(Type.CHOICE_ATTRIBUTE_NAME, choice);
I_Type choiceOptionType = choiceType.getAttributeType(attributeChoice);
if (choiceOptionType.isSimpleType()) {
String choiceValue = m_widgetService.getDefaultAttributeValue(attributeChoice);
choice.addAttributeValue(attributeChoice, choiceValue);
break;
} else {
I_Entity choiceValue = m_vie.createEntity(null, choiceOptionType.getId());
choice.addAttributeValue(attributeChoice, choiceValue);
parentValue = choiceValue;
}
}
}