diff --git a/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.etl b/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.etl
index 98af55d60d50fc8cfc21c25fe2ebf3577e7520fa..cbcffea0bd1579b7af2e7d96220ee905f73b6307 100644
--- a/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.etl
+++ b/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.etl
@@ -31,7 +31,24 @@ rule RoleGroup
 				if(cards.size()>1) {
 					t.upper = cards[1];
 				}
-			} 
+			}
+			//only transform if the role type is in a compartment type
+			if(s.getContainer().getParent().getType==(source!Type#CompartmentType)) {
+				//get the crom equivalent to compartment type the role type is in
+				var compartmentType = s.getContainer.getParent().equivalent();
+				//check if a part with that role does not already is added to the compartment type
+				var partAlreadyAdded = false;
+				for(alreadyAddedPart : target!Part in compartmentType.getParts()) {
+					if(alreadyAddedPart.role == s.~transformed) partAlreadyAdded = true;
+				}
+				if(not(partAlreadyAdded)) {
+					//create a new part with the role
+					var part = new target!Part;
+					part.role = s.~transformed;
+					part.whole = compartmentType;
+					//add the part to the compartment type the role type 
+					compartmentType.getParts().add(part);
+			}	}		
 			//transform children
 			var children = s.`model`;
 			if (not (children == null)) {
diff --git a/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroupOccurenceConstraints.etl b/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroupOccurenceConstraints.etl
index 5556ce74dd1ccd856906b08771c2444b51775755..2a7b3066199d801bd21666854b88a1082cd0d162 100644
--- a/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroupOccurenceConstraints.etl
+++ b/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroupOccurenceConstraints.etl
@@ -25,7 +25,7 @@ rule RoleGroupWithOccurenceConstraints
 		guard : not(s.getContainer().getParent() == null) and 
 				s.getContainer().getParent().getType==(source!Type#CompartmentType) and
 				s.~features.get("Occurrence_Constraints")
-			
+		
 		//parse the lower and upper bound from the role
 		var desc = s.description;
 		if (not (desc == null)) {