code: private void addComplexChoiceValue(CmsAttributeValueView reference, List<String> choicePath) {
  
          CmsEntity value = m_entityBackEnd.createEntity(null, getAttributeType().getId());
          CmsEntity parentValue = value;
          for (String attributeChoice : choicePath) {
              CmsType choiceType = m_entityBackEnd.getType(parentValue.getTypeName()).getAttributeType(
                  CmsType.CHOICE_ATTRIBUTE_NAME);
              CmsEntity choice = m_entityBackEnd.createEntity(null, choiceType.getId());
              parentValue.addAttributeValue(CmsType.CHOICE_ATTRIBUTE_NAME, choice);
              CmsType choiceOptionType = choiceType.getAttributeType(attributeChoice);
              if (choiceOptionType.isSimpleType()) {
                  String choiceValue = m_widgetService.getDefaultAttributeValue(attributeChoice, getSimplePath(0));
                  choice.addAttributeValue(attributeChoice, choiceValue);
                  break;
              } else {
                  CmsEntity choiceValue = m_entityBackEnd.createEntity(null, choiceOptionType.getId());
                  choice.addAttributeValue(attributeChoice, choiceValue);
                  parentValue = choiceValue;
              }
          }
          insertValueAfterReference(value, reference);
          if (getMaxOccurence() == 1) {
              reference.setCollapsed(true);
          }
      }
docs: Adds a new complex value which corresponds to a choice element.<p>
  
  @param reference the reference view
  @param choicePath the path of choice attribute names