Instructions
This language allows in a single transformation, adapting metamodels and the composition of adapted metamodels. To accomplish this, EnAr-Fusion offers 17 instructions that can act on the input metamodels and on the composite metamodel.
Considering the two metamodels called mm1 and mm2 showed in the last section.
newEntity
Creates a new entity in the composite metamodel. This entity has neither attributes nor relationships with other elements.
newEntity N
newEntity
Restrictions
deleteEntity
Deletes an entity in the composite metamodel.
deleteEntity exampleMM1.C
deleteEntity
Restrictions
The entity “C” must exist in the metamodel mm1.
The package is optional. If the instruction does not include the package, the entity “C” must be created before.
renameEntity
Renames an entity in the composite metamodel.
renameEntity exampleMM1.C “D”
renameEntity
Restrictions
The entity “C” must exist in the metamodel mm1
The entity “D” may not exist in the composite metamodel
The package is optional. If the instruction does not include the package, the entity “C” must be created before.
setAbstractEntity
Converts an entity in an abstract entity in the composite metamodel.
setAbstractEntity exampleMM2.Z
setAbstractEntity
Restrictions
The entity “Z” must exist in the metamodel mm2
The package is optional. If the instruction does not include the package, the entity “Z” must be created before.
setNonAbstractEntity
Converts an abstract entity in non abstract entity in the composite metamodel.
setNonAbstractEntity exampleMM1.A
setNonAbstractEntity
Restrictions
The entity “A” must exist in the metamodel mm1
The package is optional. If the instruction does not include the package, the entity “A” must be created before.
addAttribute
Adds an attribute into an entity in the composite metamodel. This attribute must have type and the optional property.
addAttribute attA3{
source=exampleMM1.A
type=EInt
optional=true
}
addAttribute
Restrictions
The entity “A” must exist in the metamodel mm1
The attribute “attA3” may not exist in the entity “A”
The source package is optional. If the instruction does not include the package, the entity “A” must be created before.
removeAttribute
Removes an attribute from an entity in the composite metamodel.
removeAttribute exampleMM1.A.attA2
removeAttribute
Restrictions
The entity “A” must exist in the metamodel mm1
The attribute “attA2” must exist in the entity “A”
The source package is optional. If the instruction does not include the package, the entity “A” must be created before.
updateAttribute
Updates an attribute into an entity in the composite metamodel. This attribute must have type and the optional property.
updateAttribute exampleMM1.A.attA1{
type=EInt
optional=false
}
updateAttribute
Restrictions
The entity “A” must exist in the metamodel mm1
The attribute “attA1” must exist in the entity “A”
The source package is optional. If the instruction does not include the package, the entity “A” must be created before.
renameAttribute
Renames attribute in the composite metamodel.
renameAttribute exampleMM1.A.attA2 “attA3”
renameAttribute
Restrictions
The entity “A” must exist in the metamodel mm1
The attribute “attA2” must exist in the entity “A”
The attribute “attA3” may not exist in the entity “A”
The source package is optional. If the instruction does not include the package, the entity “A” must be created before
newLink
Establishes a new link between two entities in the composite metamodel. The attributes of a link are: identifier, source entity, target entity, containment, cardinality and asociated link (optional).
newLink C_X{
source=exampleMM1.C
target=exampleMM2.X
containment=true
minCard=1
maxCard=-1
associatedLink=X_C
}
newLink
Restrictions
The entity “C” must exist in the metamodel mm1
The entity “X” must exist in the metamodel mm2
The Link “C_X” may not exist in the composite metamodel
minCard must be greater or equal than 0
maxCard must be greater or equal than -1
The source package is optional. If the instruction does not include the package, the entity “C” must be created before
The target package is optional. If the instruction does not include the package, the entity “X” must be created before
deleteLink
Deletes a link between two entities in the composite metamodel.
deleteLink exampleMM2.X.X_Y
deleteLink
Restrictions
The link “X_Y” must belong to the entity X
The entity X must exist in the metamodel mm2
The source package is optional. If the instruction does not include the package, the entity “X” must be created before
updateLink
Updates a link between two entities in the composite metamodel. The attributes of a link are: identifier, source entity, target entity, containment, cardinality and asociated link (optional).
updateLink exampleMM2.Y.Y_Z{
containment=true
minCard=0
maxCard=1
}
updateLink
Restrictions
The link “Y_Z” must belong to the entity Y
The entity Y must exist in the metamodel mm2
minCard must be greater or equal than 0
maxCard must be greater or equal than -1
The package is optional. If the instruction does not include the package, the entity “Y” must be created before
newInheritanceLink
Creates an inheritance link between a sub entity and a super entity in the composite metamodel.
newInheritanceLink{
subEntity=exampleMM2.X
superEntity=exampleMM1.A
}
newInheritanceLink
Restrictions
The entity “X” must exist in the metamodel mm2
The entity “A” must exist in the metamodel mm1
The subEntity package is optional. If the instruction does not include the package, the entity “X” must be created before
The superEntity package is optional. If the instruction does not include the package, the entity “A” must be created before
The sub entity should not have another inheritance link.
deleteInheritanceLink
Deletes an inheritance link of a sub entity in the composite metamodel
deleteInheritanceLink exampleMM1.B
deleteInheritanceLink
Restrictions
The entity “B” must exist in the metamodel mm1
The entity “B” should have an inheritance link
The package is optional. If the instruction does not include the package, the entity “B” must be created before
mergeEntities
Creates a new entity from two existing entities in the composite metamodel. The new entity is a mixture of the two previous entities and groups all attributes and links that existed before.
mergeEntities CX{
entity1=exampleMM1.C
entity2=exampleMM2.X
}
mergeEntities
Restrictions
The entity “C” must exist in the metamodel mm1
The entity “X” must exist in the metamodel mm2
The name of the attributes in the entity “C” must be different than the name of the attributes in the entity “X”
The entity1 package is optional. If the instruction does not include the package, the entity “C” must be created before
The entity2 package is optional. If the instruction does not include the package, the entity “X” must be created before
splitEntity
Creates new entities in the composite metamodel, from an existing entity. The entity's attributes and entity's links should be shared between the created entities.
splitEntity exampleMM2.X{
entity X1{
Attributes{
attX1
}
Links{
X_Y
}
}
entity X2{
Attributes{
attX2
}
Links{
X_Y
}
}
}
splitEntity
Restrictions
The entity “X” must exist in the metamodel mm2
The entity “X1” may not exist in the composite metamodel
The entity “X2” may not exist in the composite metamodel
At least must be implemented two split entities
All attributes in the entity “X”, must be assigned in at least one split entity
All links over the entity “X”, must be assigned in at least one split entity