+
+ if (resourceModel.hasWidgetType("ALLOTTED_RESOURCE") && !foundProvidingService) {
+ final String modelInvariantId = resourceModel.getModelId();
+ throw new IllegalArgumentException(String.format(GENERATOR_AAI_PROVIDING_SERVICE_MISSING,
+ modelInvariantId == null ? "<null ID>" : modelInvariantId));
+ }
+ }
+
+ /**
+ * Create an Instance Group Model and populate it with the supplied data.
+ *
+ * @param resourceModel
+ * the Resource node template Model
+ * @param memberNodes
+ * the Resources and Widgets belonging to the Group
+ * @param metaProperties
+ * the metadata of the Group
+ * @param properties
+ * the properties of the Group
+ * @return the Instance Group and Member resource models
+ * @throws XmlArtifactGenerationException
+ * if there is no configuration defined for one of the member Widgets
+ */
+ private List<Resource> processInstanceGroup(Model resourceModel, ArrayList<NodeTemplate> memberNodes,
+ Map<String, String> metaProperties, Map<String, Property> properties)
+ throws XmlArtifactGenerationException {
+ Resource groupModel = createInstanceGroupModel(mergeProperties(metaProperties, properties));
+ resourceModel.addResource(groupModel);
+ List<Resource> resources = Stream.of(groupModel).collect(Collectors.toList());
+
+ if (memberNodes != null && !memberNodes.isEmpty()) {
+ resources.addAll(generateResourcesAndWidgets(memberNodes, groupModel));
+ }
+