# Towards Agent Organizations Interoperability: A Model Driven Engineering Approach
## 5 Integration Method Application
### Second Iteration  
In the second iteration, we integrate the MOISE+ metamodel (structural dimension) to the resulting metamodel \(MM_{\#1}^{int}\) obtained in the previous iteration. The MOISE+ metamodel is shown on the left side of Figure 8. On the right side, we have \(MM_{\#1}^{int}\) (from Figure 7) augmented with derived classes and relationships. On the middle, there is the articulation graph between MOISE+ and \(MM_{\#1}^{int}\) metamodels. Since the articulation graph preserves the class and reference names from \(MM_{\#1}^{int}\), for simplicity we have omitted the morphism \(m_{2}:G^{art}\to MM_{\#1}^{int}\). In \(MM_{\#1}^{int}\) there are three classes GroupDef, RoleDef and RoleRel which represent the main concepts for the structural specification of agent organizations. In MOISE+, the correspondent classes are GroupSpecification, Role and RoleRelation, respectively. Similar to class \(MM_{\#1}^{int}::\)GroupDef, class MOISE+::GroupSpecification represents the definition of a _group_ in which it is possible to specify _roles_ and _subgroups_. Like \(MM_{\#1}^{int}::\)RoleDef, the class MOISE+::Role denotes a _role definition_ associated with _group definitions_. Both \(MM_{\#1}^{int}::\)RoleRel and MOISE+::RoleRelation characterize _role relationships_ from a target to a source _role definition_. Apart from this basic agreement, there are some particularities regarding how these concepts occur in MOISE+ that leads to an extension of \(MM_{\#1}^{int}\). One first particularity is the way in which _group definitions_ are linked to _role definitions_ and _subgroups_. In the integration of AGR and STEAM, _group definitions_ are linked to _role definitions_ and to _subgroups_ by means of the roleDef and subGroup references, respectively. In the MOISE+ metamodel the correspondent links are not represented by references but by the classes GroupRelo and SubGroup, respectively. By means of MOISE++:GroupRole and MOISE++:SubGroup, the same _role definition_ or _subgroup_ can have different cardinalities, one for each _group definition_ in which the definition is referenced. The cardinalities are represented by the attributes max (for the maximum number of agents per role, or subgroups in a group) and min (for the minimum number). In \(MM_{\#1}^{int}\) this flexibility is not possible as long as the cardinalities are declared directly as attributes of the _role definition_, and not as attributes of the relation between a _group definition_ and _role_ or _subgroup definition_. In this way, we note that the information about role and group cardinalities of MOISE+ can not always be expressed in the current integration of ARG and STEAM. However, the converse is always possible, as it can be shown by means of the derived classes \(MM_{\#1}^{int}\)::RoleRef and \(MM_{\#1}^{int}\)::GroupRef in the upper right of Figure 8.  
The derived class \(MM_{\#1}^{int}\)::RoleRef is the implicit correspondent of MOISE++:GroupRole. Similar to class MOISE++:GroupRole, class \(MM_{\#1}^{int}\)::RoleRef has attributes max and min and makes reference a single _role definition_. In the context of \(MM_{\#1}^{int}\)::GroupDef the derivation of \(MM_{\#1}^{int}\)::RoleRef is specified by the invariant GD2 shown in the bottom right of Figure 8. This invariant establishes that for each instance rd of \(MM_{\#1}^{int}\)::RoleDef (referenced by roleDef), there must exist (be created) an instance rr of \(MM_{\#1}^{int}\)::RoleRef that points to rd and has the attributes rr.min = rd.min and rr.max = rd.max. By its turn, the class \(MM_{\#1}^{int}\)::GroupRef is the derived correspondent of MOISE++:SubGroup.