public void addResource(Ressource res) { ressources.Add(res); }
public RessourceAssignement() { ressource = new Ressource(); entity = new Entity(); }
public void addOrganisationalStructure(XElement orgNode) { XAttribute orgName = (XAttribute)orgNode.Attribute("name"); OrganisationalStructure organisation = new OrganisationalStructure(orgName.Value); organisation.Description = getComment(orgNode); organisation.Summary = getSummary(orgNode); organisation.Tags = getTags(orgNode); //Debug.Log(MascaretApplication.Instance.Model.name); MascaretApplication.Instance.AgentPlateform.Structures.Add(organisation); foreach (XElement child in orgNode.Elements()) { if (child.Name.LocalName.CompareTo("ownedAttribute") == 0) { string childType = "", roleName = ""; Classifier classe = null; XAttribute attr = (XAttribute)child.Attribute("type"); if (attr != null) { childType = attr.Value; classe = this._classifiers[childType]; } attr = (XAttribute)child.Attribute("name"); if (attr != null) roleName = attr.Value; if (classe != null) { try { Role role = new Role(roleName); role.RoleClass = (RoleClass)classe; organisation.addRole(role); } catch (InvalidCastException) { try { Ressource ressource = new Ressource(roleName); ressource.EntityClass = (EntityClass)classe; organisation.addResource(ressource); } catch (InvalidCastException) { } } } } } foreach (XElement child in orgNode.Elements()) { if (child.Name.LocalName.CompareTo("ownedBehavior") == 0) { string childType = "", childName = "", childId = ""; XAttribute attr = (XAttribute)child.Attribute("{http://schema.omg.org/spec/XMI/2.1}type"); if (attr == null) attr = (XAttribute)child.Attribute("{http://www.omg.org/spec/XMI/20131001}type"); if (attr != null) childType = attr.Value; attr = (XAttribute)child.Attribute("name"); if (attr != null) childName = attr.Value; attr = (XAttribute)child.Attribute("{http://schema.omg.org/spec/XMI/2.1}id"); if (attr == null) attr = (XAttribute)child.Attribute("{http://www.omg.org/spec/XMI/20131001}id"); if (attr != null) childId = attr.Value; if (childType.CompareTo("uml:Activity") == 0) { Activity activity = addActivity(child); Procedure procedure = null; MascaretApplication.Instance.VRComponentFactory.Log(" ?????? Procedure : " + childId); if (isStereotypedScenarioPedagogique(child)) { procedure = new PedagogicalScenario(childName); XAttribute attr2 = child.Attribute("{http://schema.omg.org/spec/XMI/2.1}id"); if (attr2 == null) attr2 = child.Attribute("{http://www.omg.org/spec/XMI/20131001}id"); ((PedagogicalScenario)procedure).Scene = _scenarioToScene[attr2.Value]; } else procedure = new Procedure(childName); procedure.Activity = activity; string stereo = getStereotype(childId); MascaretApplication.Instance.VRComponentFactory.Log("procedure;;;;;;;;;;;;;;;;;;;;;;;;;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + childName + " : " + childId + " " + stereo); if (stereo != "") { procedure.Stereotype = stereo; } organisation.addProcedure(procedure); _idBehaviors.Add(childId, activity); } } } }
public RessourceAssignement() { ressource = new Ressource(); entity = new Entity(); }