public boolean generateNodesInstances(IStructure structure) throws Exception { List<INode> nodesInstances = new ArrayList<INode>(); Collection<ClassDefinition> createdTypes = new ArrayList<ClassDefinition>(); Collection<ClassDefinition> types = ((AlfrescoModelStructure) structure).getTypes(); Collection<AssociationDefinition> compositions = generatorServices.extractCompositions( ((AlfrescoModelStructure) structure).getAssociations()); for (int numOfNodes = 0; numOfNodes < numberOfNodes; numOfNodes++) { ClassDefinition type = RandomMethods.selectRandomlyType(types); createdTypes.add(type); } Map<AssociationDefinition, Collection<ClassDefinition>> sourcesTypesOfCompositions = generatorServices.getSourcesTypesOfCompositions(createdTypes, compositions); Collection<ClassDefinition> deletedTargetsTypes = generatorServices.deleteTargetsTypesOfNotCreatedTargetsTypesOfCompositions( sourcesTypesOfCompositions, createdTypes); createdTypes.removeAll(deletedTargetsTypes); for (ClassDefinition type : createdTypes) { indexType.put(type, Integer.valueOf(0)); } for (ClassDefinition type : createdTypes) { generatorServices.getSerializedDataFromFile(); generatorServices.initializeUnicityVariables(createdTypes, type); nodesInstances.add(((Instance) instance).instanciation(type)); Integer newValue = Integer.valueOf(indexType.get(type).intValue() + 1); indexType.put(type, newValue); generatorServices.serializeData(); } ((AlfrescoModelData) alfrescoModelDatas).setGeneratedTypesInstances(nodesInstances); // Reinitialization because beans still exist until Alfresco be shutdown generatorServices.reInitialization(); return true; }