From b5672f022ca5c314402d5953249b06cc658ffc99 Mon Sep 17 00:00:00 2001
From: nullsub <chrisudeussen@gmail.com>
Date: Wed, 13 Jun 2018 10:41:46 +0200
Subject: [PATCH] update editpolicy textfiles

---
 .../core/inheritance/Inheritance.ecl          |  6 ++--
 .../core/inheritance/Inheritance.editpolicy   | 34 ++++++++++++++-----
 .../inheritance/CompartmentInheritance.ecl    |  1 +
 .../CompartmentInheritance.editpolicy         | 12 +++++++
 .../playing_own_roles/PlayingOwnRoles.ecl     |  6 ++--
 .../inheritance/DataTypeInheritance.ecl       |  3 +-
 .../DataTypeInheritance.editpolicy            | 12 +++++++
 .../roletype/inheritance/RoleInheritance.ecl  |  3 +-
 .../inheritance/RoleInheritance.editpolicy    | 12 +++++++
 9 files changed, 73 insertions(+), 16 deletions(-)

diff --git a/org.framed.iorm.ui/core/inheritance/Inheritance.ecl b/org.framed.iorm.ui/core/inheritance/Inheritance.ecl
index 521980d3..69b2cfae 100644
--- a/org.framed.iorm.ui/core/inheritance/Inheritance.ecl
+++ b/org.framed.iorm.ui/core/inheritance/Inheritance.ecl
@@ -1,8 +1,8 @@
 //Inheritance  
 Start Inheritance (Naturals) when IsSourceType(NaturalType); 
-Add Inheritance (Naturals) when IsSourceType(NaturalType) and SourceEqualsTargetType();
-Reconnect Inheritance (Naturals) when IsSourceType(NaturalType) and SourceEqualsTargetType();
+Add Inheritance (Naturals) when IsSourceType(NaturalType) and SourceEqualsTargetType() and !SourceEqualsTarget();
+Reconnect Inheritance (Naturals) when IsSourceType(NaturalType) and SourceEqualsTargetType() and !SourceEqualsTarget();
+Create Inheritance (Naturals) when IsSourceType(NaturalType) and SourceEqualsTargetType() and !SourceEqualsTarget();
 
 Execute Inheritance (true) when true;
-Create Inheritance (true) when true;
  
diff --git a/org.framed.iorm.ui/core/inheritance/Inheritance.editpolicy b/org.framed.iorm.ui/core/inheritance/Inheritance.editpolicy
index 14ecccc3..62b39a03 100644
--- a/org.framed.iorm.ui/core/inheritance/Inheritance.editpolicy
+++ b/org.framed.iorm.ui/core/inheritance/Inheritance.editpolicy
@@ -7,22 +7,40 @@
   <policies action="Add" actionType="Inheritance">
     <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Naturals"/>
     <constraintRule xsi:type="editpolicymodel:AndConstraintRule">
-      <rules xsi:type="editpolicymodel:IsSourceType" type="NaturalType"/>
-      <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+      <rules xsi:type="editpolicymodel:AndConstraintRule">
+        <rules xsi:type="editpolicymodel:IsSourceType" type="NaturalType"/>
+        <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+      </rules>
+      <rules xsi:type="editpolicymodel:NotConstraintRule">
+        <rule xsi:type="editpolicymodel:SourceEqualsTarget"/>
+      </rules>
     </constraintRule>
   </policies>
   <policies action="Reconnect" actionType="Inheritance">
     <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Naturals"/>
     <constraintRule xsi:type="editpolicymodel:AndConstraintRule">
-      <rules xsi:type="editpolicymodel:IsSourceType" type="NaturalType"/>
-      <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+      <rules xsi:type="editpolicymodel:AndConstraintRule">
+        <rules xsi:type="editpolicymodel:IsSourceType" type="NaturalType"/>
+        <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+      </rules>
+      <rules xsi:type="editpolicymodel:NotConstraintRule">
+        <rule xsi:type="editpolicymodel:SourceEqualsTarget"/>
+      </rules>
     </constraintRule>
   </policies>
-  <policies action="Execute" actionType="Inheritance">
-    <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
-    <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
-  </policies>
   <policies actionType="Inheritance">
+    <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Naturals"/>
+    <constraintRule xsi:type="editpolicymodel:AndConstraintRule">
+      <rules xsi:type="editpolicymodel:AndConstraintRule">
+        <rules xsi:type="editpolicymodel:IsSourceType" type="NaturalType"/>
+        <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+      </rules>
+      <rules xsi:type="editpolicymodel:NotConstraintRule">
+        <rule xsi:type="editpolicymodel:SourceEqualsTarget"/>
+      </rules>
+    </constraintRule>
+  </policies>
+  <policies action="Execute" actionType="Inheritance">
     <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/>
     <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/>
   </policies>
diff --git a/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl b/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl
index 9ef3378c..aab00a25 100644
--- a/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl
+++ b/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl
@@ -1,4 +1,5 @@
 //Inheritance or Role_Inheritance/Data_Type_Inheritance/Compartment_Inheritance     
 Start Inheritance (Compartment_Inheritance) when IsSourceType(CompartmentType); 
 Add Inheritance (Compartment_Inheritance) when IsSourceType(CompartmentType) and !SourceEqualsTarget() and SourceEqualsTargetType(); //acyclic
+Create Inheritance (Compartment_Inheritance) when IsSourceType(CompartmentType) and !SourceEqualsTarget() and SourceEqualsTargetType(); //acyclic
    
\ No newline at end of file
diff --git a/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.editpolicy b/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.editpolicy
index ec8c7943..23f4d18c 100644
--- a/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.editpolicy
+++ b/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.editpolicy
@@ -16,4 +16,16 @@
       <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
     </constraintRule>
   </policies>
+  <policies actionType="Inheritance">
+    <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Compartment_Inheritance"/>
+    <constraintRule xsi:type="editpolicymodel:AndConstraintRule">
+      <rules xsi:type="editpolicymodel:AndConstraintRule">
+        <rules xsi:type="editpolicymodel:IsSourceType" type="CompartmentType"/>
+        <rules xsi:type="editpolicymodel:NotConstraintRule">
+          <rule xsi:type="editpolicymodel:SourceEqualsTarget"/>
+        </rules>
+      </rules>
+      <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+    </constraintRule>
+  </policies>
 </editpolicymodel:Model>
diff --git a/org.framed.iorm.ui/modules/compartment/playing_own_roles/PlayingOwnRoles.ecl b/org.framed.iorm.ui/modules/compartment/playing_own_roles/PlayingOwnRoles.ecl
index 1bb16c02..16418840 100644
--- a/org.framed.iorm.ui/modules/compartment/playing_own_roles/PlayingOwnRoles.ecl
+++ b/org.framed.iorm.ui/modules/compartment/playing_own_roles/PlayingOwnRoles.ecl
@@ -1,5 +1,5 @@
 //Playing_own_roles 
 Start Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType); 
-Add Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTargetType();
-Create Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTargetType();
-Reconnect Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTargetType();
\ No newline at end of file
+Add Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTarget();
+Create Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTarget();
+Reconnect Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType) and SourceEqualsTarget();
\ No newline at end of file
diff --git a/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl b/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl
index 5f16ed67..735b2261 100644
--- a/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl
+++ b/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl
@@ -1,4 +1,5 @@
 //Inheritance or Role_Inheritance/Data_Type_Inheritance/Compartment_Inheritance
 Start Inheritance (Data_Type_Inheritance) when IsSourceType(DataType);  
 Add Inheritance (Data_Type_Inheritance) when IsSourceType(DataType) and !SourceEqualsTarget() and SourceEqualsTargetType(); // check acyclic
-Reconnect Inheritance (Data_Type_Inheritance) when IsSourceType(DataType) and !SourceEqualsTarget() and SourceEqualsTargetType(); // check acyclic
\ No newline at end of file
+Reconnect Inheritance (Data_Type_Inheritance) when IsSourceType(DataType) and !SourceEqualsTarget() and SourceEqualsTargetType();
+Create Inheritance (Data_Type_Inheritance) when IsSourceType(DataType) and !SourceEqualsTarget() and SourceEqualsTargetType(); // check acyclic // check acyclic
\ No newline at end of file
diff --git a/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.editpolicy b/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.editpolicy
index 49d98fc4..e482907a 100644
--- a/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.editpolicy
+++ b/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.editpolicy
@@ -28,4 +28,16 @@
       <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
     </constraintRule>
   </policies>
+  <policies actionType="Inheritance">
+    <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Data_Type_Inheritance"/>
+    <constraintRule xsi:type="editpolicymodel:AndConstraintRule">
+      <rules xsi:type="editpolicymodel:AndConstraintRule">
+        <rules xsi:type="editpolicymodel:IsSourceType" type="DataType"/>
+        <rules xsi:type="editpolicymodel:NotConstraintRule">
+          <rule xsi:type="editpolicymodel:SourceEqualsTarget"/>
+        </rules>
+      </rules>
+      <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+    </constraintRule>
+  </policies>
 </editpolicymodel:Model>
diff --git a/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl b/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl
index 9616538d..a4ef4808 100644
--- a/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl
+++ b/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl
@@ -1,4 +1,5 @@
 //Inheritance or Role_Inheritance/Data_Type_Inheritance/Compartment_Inheritance 
 Start Inheritance (Role_Inheritance) when IsSourceType(RoleType);   
 Add Inheritance (Role_Inheritance) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType();  //TODO, check acyclic 
-Reconnect Inheritance (Role_Inheritance) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType();  //TODO, check acyclic 
\ No newline at end of file
+Reconnect Inheritance (Role_Inheritance) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType(); 
+Create Inheritance (Role_Inheritance) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType();  //TODO, check acyclic  //TODO, check acyclic 
\ No newline at end of file
diff --git a/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.editpolicy b/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.editpolicy
index 6afa29cb..46b47e89 100644
--- a/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.editpolicy
+++ b/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.editpolicy
@@ -28,4 +28,16 @@
       <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
     </constraintRule>
   </policies>
+  <policies actionType="Inheritance">
+    <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Role_Inheritance"/>
+    <constraintRule xsi:type="editpolicymodel:AndConstraintRule">
+      <rules xsi:type="editpolicymodel:AndConstraintRule">
+        <rules xsi:type="editpolicymodel:IsSourceType" type="RoleType"/>
+        <rules xsi:type="editpolicymodel:NotConstraintRule">
+          <rule xsi:type="editpolicymodel:SourceEqualsTarget"/>
+        </rules>
+      </rules>
+      <rules xsi:type="editpolicymodel:SourceEqualsTargetType"/>
+    </constraintRule>
+  </policies>
 </editpolicymodel:Model>
-- 
GitLab