public static Vector<Hashtable<String,String>> getPossibleRoleAssignment(String relationshipType, String[] connectedEntities, Graph graph, Browser browser) throws NotFound{ Vector<GraphCell> entities=new Vector<GraphCell>(); for (String entityID:connectedEntities) { DefaultGraphCell entity = findEntity(entityID,graph); if (entity==null) throw new ingenias.exception.NotFound("Entity "+entityID+" that you tried to connect did not exist in the graph "+graph.getName()); entities.add(entity); } GraphCell[] selected=new GraphCell[entities.size()]; selected=entities.toArray(selected); NAryEdge nEdge=(NAryEdge) RelationshipFactory.getNRelationshipInstance(relationshipType, selected,browser); Vector<Hashtable<String, String>> result = convertToVectorHashtable(connectedEntities, selected, nEdge); return result; }
public Vector<Hashtable<String,String>> getPossibleRoleAssignment(String relationshipType, String[] connectedEntities) throws NotFound{ Vector<GraphCell> entities=new Vector<GraphCell>(); for (String entityID:connectedEntities) { DefaultGraphCell entity = findEntity(entityID); if (entity==null){ // the entity may have not been created yet as graphical object // The object manager may know about it. if (this.ids.om.findUserObject(entityID).size()>0) entity=new DefaultGraphCell(this.ids.om.findUserObject(entityID).firstElement()); else throw new ingenias.exception.NotFound("Entity "+entityID+" that you tried to connect did not exist in any graph "); } //throw new ingenias.exception.NotFound("Entity "+entityID+" that you tried to connect did not exist in any graph "); entities.add(entity); } GraphCell[] selected=new GraphCell[entities.size()]; selected=entities.toArray(selected); NAryEdge nEdge=(NAryEdge) RelationshipFactory.getNRelationshipInstance(relationshipType, selected,browser); Vector<Hashtable<String, String>> result = convertToVectorHashtable(connectedEntities, selected, nEdge); return result; }