Skip to content
Snippets Groups Projects
Commit 23345fba authored by Kevin Kassin's avatar Kevin Kassin
Browse files

Commit 19.9 16:40

enabled relations in groups,
implemented fulfillments for roles in compartment types
parent 1e91f7bc
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,9 @@ rule CompartmentType
// iterate over all children of the compartment type
for (elem : source!ModelElement in children.elements) {
elem.println();
var e = elem.equivalent();
e.println();
if (e == null) { continue; }
if (e.instanceOf(target!AbstractRole)) { // ROLE
......@@ -51,13 +52,17 @@ rule CompartmentType
n.getContains.add(e);
if(not(t.~features.get("Contains_Compartments"))) n.getContains.remove(e);
} else if (e.instanceOf(target!RelationshipImplication) or e.instanceOf(target!RelationshipExclusion)) { // INTER_RELATIONSHIP_CONSTRAINT
n.getConstraints().add(e); //add CONSTRAINTS as well
n.getConstraints().add(e);
} else if ( e.instanceOf(target!Constraint)) { // CONSTRAINT
n.getConstraints().add(e);
} else if ( e.instanceOf(target!Relationship)) { // RELATIONSHIP
n.getRelationships().add(e);
} else if ( e.instanceOf(target!RoleInheritance)) {
} else if ( e.instanceOf(target!RoleInheritance)) { //INHERITANCE
t.~parent.relations.add(e);
} else if ( e.instanceOf(Sequence)) { //FULFILLMENT
for(ob in e) {
n.getFulfillments.add(ob);
}
}
}
}
......
......@@ -6,7 +6,7 @@ operation toTransform(t : source!Relation) : Boolean {
if((t.source==t.target and t.~features.get("Playable_by_Defining_Compartment"))) return true;
}
case 1: return true;
//case 2: if(t.~features.get("Roles")) return true;
case 2: if(t.~features.get("Roles")) return true;
case 3: if(t.~features.get("Dates")) return true;
}
return false;
......
......@@ -11,8 +11,7 @@ rule Group
for (e in children.elements) e.~features=s.~features;
for (elem : source!ModelElement in children.elements) {
var e = elem.equivalent();
if(e.instanceOf(target!Inheritance) or
e.instanceOf(target!Fulfillment)) {
if(e.instanceOf(target!Relation)) {
if(not(e==null)) t.getRelations().add(e);
} else {
if(not(e==null)) t.getElements().add(e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment