From 20cfa163332a67d0a2fb740f3ac5beeec94684f2 Mon Sep 17 00:00:00 2001 From: tkuehn <thomas.kuehn3@tu-dresden.de> Date: Wed, 13 Jun 2018 20:13:47 +0200 Subject: [PATCH] modified ecl and editpolicies --- .../AttributeAndOperation.ecl | 11 ------- .../core/fulfillment/Fulfillment.ecl | 22 ------------- org.framed.iorm.ui/core/group/Group.ecl | 1 + .../core/group/Group.editpolicy | 4 +++ .../core/inheritance/Inheritance.ecl | 8 ----- .../core/naturaltype/NaturalType.ecl | 1 + .../core/naturaltype/NaturalType.editpolicy | 4 +++ .../core/rolemodel/RoleModel.ecl | 7 ++++ .../core/rolemodel/RoleModel.editpolicy | 33 +++++++++++++++++++ org.framed.iorm.ui/core/roletype/RoleType.ecl | 3 ++ .../core/roletype/RoleType.editpolicy | 15 +++++++++ .../modules/compartment/CompartmentTypes.ecl | 7 +--- .../compartment/CompartmentTypes.editpolicy | 26 --------------- .../ContainsCompartments.ecl | 3 -- .../inheritance/CompartmentInheritance.ecl | 5 --- .../playing_own_roles/PlayingOwnRoles.ecl | 5 --- .../modules/datatype/DataTypes.ecl | 3 +- .../modules/datatype/DataTypes.editpolicy | 4 +++ .../inheritance/DataTypeInheritance.ecl | 5 --- .../modules/relationship/Relationship.ecl | 7 ---- .../InterRelationship.ecl | 10 ------ ...actIntraRelationshipConstraintPattern.java | 18 +++++++--- .../IntraRelationship.ecl | 20 ----------- .../roletype/group_constraints/RoleGroup.ecl | 3 -- .../roletype/inheritance/RoleInheritance.ecl | 5 --- .../role_constraints/RoleConstraints.ecl | 15 --------- 26 files changed, 88 insertions(+), 157 deletions(-) delete mode 100644 org.framed.iorm.ui/core/attributeAndOperation/AttributeAndOperation.ecl delete mode 100644 org.framed.iorm.ui/core/fulfillment/Fulfillment.ecl delete mode 100644 org.framed.iorm.ui/core/inheritance/Inheritance.ecl create mode 100644 org.framed.iorm.ui/core/rolemodel/RoleModel.ecl create mode 100644 org.framed.iorm.ui/core/rolemodel/RoleModel.editpolicy create mode 100644 org.framed.iorm.ui/core/roletype/RoleType.ecl create mode 100644 org.framed.iorm.ui/core/roletype/RoleType.editpolicy delete mode 100644 org.framed.iorm.ui/modules/compartment/contains_compartments/ContainsCompartments.ecl delete mode 100644 org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl delete mode 100644 org.framed.iorm.ui/modules/compartment/playing_own_roles/PlayingOwnRoles.ecl delete mode 100644 org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl delete mode 100644 org.framed.iorm.ui/modules/relationship/Relationship.ecl delete mode 100644 org.framed.iorm.ui/modules/relationship/inter_relationship_constraints/InterRelationship.ecl delete mode 100644 org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/IntraRelationship.ecl delete mode 100644 org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.ecl delete mode 100644 org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl delete mode 100644 org.framed.iorm.ui/modules/roletype/role_constraints/RoleConstraints.ecl diff --git a/org.framed.iorm.ui/core/attributeAndOperation/AttributeAndOperation.ecl b/org.framed.iorm.ui/core/attributeAndOperation/AttributeAndOperation.ecl deleted file mode 100644 index 120acdaa..00000000 --- a/org.framed.iorm.ui/core/attributeAndOperation/AttributeAndOperation.ecl +++ /dev/null @@ -1,11 +0,0 @@ -//NaturalType -Create_Attribute NaturalType (true) when true; -Create_Operation NaturalType (true) when true; -Create_Property NaturalType (true) when true; -Add_Property NaturalType (true) when true; - -//NaturalType -Create_Attribute DataType (true) when true; -Create_Operation DataType (true) when true; -Create_Property DataType (true) when true; -Add_Property DataType (true) when true; diff --git a/org.framed.iorm.ui/core/fulfillment/Fulfillment.ecl b/org.framed.iorm.ui/core/fulfillment/Fulfillment.ecl deleted file mode 100644 index 83c3a991..00000000 --- a/org.framed.iorm.ui/core/fulfillment/Fulfillment.ecl +++ /dev/null @@ -1,22 +0,0 @@ -//Fullfillment or Players?? -Start Fulfillment (Naturals) when IsSourceType(NaturalType); -Add Fulfillment (Naturals) when IsSourceType(NaturalType) and IsTargetType(CompartmentType); -Create Fulfillment (Naturals) when IsSourceType(NaturalType) and IsTargetType(CompartmentType); -Reconnect Fulfillment (Naturals) when IsSourceType(NaturalType) and IsTargetType(CompartmentType); - -Start Fulfillment (Roles) when IsSourceType(RoleType); -Add Fulfillment (Roles) when IsSourceType(RoleType) and IsTargetType(CompartmentType); -Create Fulfillment (Roles) when IsSourceType(RoleType) and IsTargetType(CompartmentType); -Reconnect Fulfillment (Roles) when IsSourceType(RoleType) and IsTargetType(CompartmentType); - -Start Fulfillment (Compartments) when IsSourceType(CompartmentType); -Add Fulfillment (Compartments) when IsSourceType(CompartmentType) and IsTargetType(CompartmentType) and !SourceEqualsTarget(); -Create Fulfillment (Compartments) when IsSourceType(CompartmentType) and IsTargetType(CompartmentType) and !SourceEqualsTarget(); -Reconnect Fulfillment (Compartments) when IsSourceType(CompartmentType) and IsTargetType(CompartmentType) and !SourceEqualsTarget(); - -Start Fulfillment (Dates) when IsSourceType(DataType); -Add Fulfillment (Dates) when IsSourceType(DataType); -Create Fulfillment (Dates) when IsSourceType(DataType); -Reconnect Fulfillment (Dates) when IsSourceType(DataType); - -Execute Fulfillment (true) when true; diff --git a/org.framed.iorm.ui/core/group/Group.ecl b/org.framed.iorm.ui/core/group/Group.ecl index 553d6f17..8303e593 100644 --- a/org.framed.iorm.ui/core/group/Group.ecl +++ b/org.framed.iorm.ui/core/group/Group.ecl @@ -1,3 +1,4 @@ Add Group (true) when true; Create Group (true) when true; +Direct_Edit Group (true) when true; diff --git a/org.framed.iorm.ui/core/group/Group.editpolicy b/org.framed.iorm.ui/core/group/Group.editpolicy index 974841fa..9fed06e8 100644 --- a/org.framed.iorm.ui/core/group/Group.editpolicy +++ b/org.framed.iorm.ui/core/group/Group.editpolicy @@ -8,4 +8,8 @@ <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> </policies> + <policies action="Direct_Edit" actionType="Group"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> + </policies> </editpolicymodel:Model> diff --git a/org.framed.iorm.ui/core/inheritance/Inheritance.ecl b/org.framed.iorm.ui/core/inheritance/Inheritance.ecl deleted file mode 100644 index 69b2cfae..00000000 --- a/org.framed.iorm.ui/core/inheritance/Inheritance.ecl +++ /dev/null @@ -1,8 +0,0 @@ -//Inheritance -Start Inheritance (Naturals) when IsSourceType(NaturalType); -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; - diff --git a/org.framed.iorm.ui/core/naturaltype/NaturalType.ecl b/org.framed.iorm.ui/core/naturaltype/NaturalType.ecl index 93bf1c30..9d1dbe86 100644 --- a/org.framed.iorm.ui/core/naturaltype/NaturalType.ecl +++ b/org.framed.iorm.ui/core/naturaltype/NaturalType.ecl @@ -1,3 +1,4 @@ Add NaturalType (true) when true; Create NaturalType (true) when true; +Direct_Edit NaturalType (true) when true; diff --git a/org.framed.iorm.ui/core/naturaltype/NaturalType.editpolicy b/org.framed.iorm.ui/core/naturaltype/NaturalType.editpolicy index 788d66ed..4c878dcc 100644 --- a/org.framed.iorm.ui/core/naturaltype/NaturalType.editpolicy +++ b/org.framed.iorm.ui/core/naturaltype/NaturalType.editpolicy @@ -8,4 +8,8 @@ <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> </policies> + <policies action="Direct_Edit" actionType="NaturalType"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> + </policies> </editpolicymodel:Model> diff --git a/org.framed.iorm.ui/core/rolemodel/RoleModel.ecl b/org.framed.iorm.ui/core/rolemodel/RoleModel.ecl new file mode 100644 index 00000000..9100a340 --- /dev/null +++ b/org.framed.iorm.ui/core/rolemodel/RoleModel.ecl @@ -0,0 +1,7 @@ +//compartmentTypes +//If Compartment_Types is not set, then only one CompartmentType can be +//added in the top-level view (This will be named RoleModel). +Add CompartmentType (!Compartment_Types) when !InType(CompartmentType) and !ContainsCompartment(); +Create CompartmentType (!Compartment_Types) when !InType(CompartmentType) and !ContainsCompartment(); +Direct_Edit CompartmentType (true) when true; + \ No newline at end of file diff --git a/org.framed.iorm.ui/core/rolemodel/RoleModel.editpolicy b/org.framed.iorm.ui/core/rolemodel/RoleModel.editpolicy new file mode 100644 index 00000000..53f05527 --- /dev/null +++ b/org.framed.iorm.ui/core/rolemodel/RoleModel.editpolicy @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="ASCII"?> +<editpolicymodel:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:editpolicymodel="http://framed/editpolicymodel"> + <policies action="Add" actionType="CompartmentType"> + <featureRule xsi:type="editpolicymodel:NotFeatureRule"> + <rule xsi:type="editpolicymodel:IsFeature" featureName="Compartment_Types"/> + </featureRule> + <constraintRule xsi:type="editpolicymodel:AndConstraintRule"> + <rules xsi:type="editpolicymodel:NotConstraintRule"> + <rule xsi:type="editpolicymodel:InType" type="CompartmentType"/> + </rules> + <rules xsi:type="editpolicymodel:NotConstraintRule"> + <rule xsi:type="editpolicymodel:ContainsCompartment"/> + </rules> + </constraintRule> + </policies> + <policies actionType="CompartmentType"> + <featureRule xsi:type="editpolicymodel:NotFeatureRule"> + <rule xsi:type="editpolicymodel:IsFeature" featureName="Compartment_Types"/> + </featureRule> + <constraintRule xsi:type="editpolicymodel:AndConstraintRule"> + <rules xsi:type="editpolicymodel:NotConstraintRule"> + <rule xsi:type="editpolicymodel:InType" type="CompartmentType"/> + </rules> + <rules xsi:type="editpolicymodel:NotConstraintRule"> + <rule xsi:type="editpolicymodel:ContainsCompartment"/> + </rules> + </constraintRule> + </policies> + <policies action="Direct_Edit" actionType="CompartmentType"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> + </policies> +</editpolicymodel:Model> diff --git a/org.framed.iorm.ui/core/roletype/RoleType.ecl b/org.framed.iorm.ui/core/roletype/RoleType.ecl new file mode 100644 index 00000000..a758b272 --- /dev/null +++ b/org.framed.iorm.ui/core/roletype/RoleType.ecl @@ -0,0 +1,3 @@ +Add RoleType (true) when InType(CompartmentType); +Create RoleType (true) when InType(CompartmentType); +Direct_Edit RoleType (true) when InType(CompartmentType); \ No newline at end of file diff --git a/org.framed.iorm.ui/core/roletype/RoleType.editpolicy b/org.framed.iorm.ui/core/roletype/RoleType.editpolicy new file mode 100644 index 00000000..0ec6eade --- /dev/null +++ b/org.framed.iorm.ui/core/roletype/RoleType.editpolicy @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="ASCII"?> +<editpolicymodel:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:editpolicymodel="http://framed/editpolicymodel"> + <policies action="Add" actionType="RoleType"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:InType" type="CompartmentType"/> + </policies> + <policies actionType="RoleType"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:InType" type="CompartmentType"/> + </policies> + <policies action="Direct_Edit" actionType="RoleType"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:InType" type="CompartmentType"/> + </policies> +</editpolicymodel:Model> diff --git a/org.framed.iorm.ui/modules/compartment/CompartmentTypes.ecl b/org.framed.iorm.ui/modules/compartment/CompartmentTypes.ecl index 5d6365d9..4000d134 100644 --- a/org.framed.iorm.ui/modules/compartment/CompartmentTypes.ecl +++ b/org.framed.iorm.ui/modules/compartment/CompartmentTypes.ecl @@ -1,8 +1,3 @@ //compartmentTypes -//If Compartment_Types is not set, then only one CompartmentType can be -//added in the top-level view (This will be named RoleModel). -Add CompartmentType (!Compartment_Types) when !InType(CompartmentType) and !ContainsCompartment(); -Create CompartmentType (!Compartment_Types) when !InType(CompartmentType) and !ContainsCompartment(); Add CompartmentType (Compartment_Types) when !InType(CompartmentType); -Create CompartmentType (Compartment_Types) when !InType(CompartmentType); - \ No newline at end of file +Create CompartmentType (Compartment_Types) when !InType(CompartmentType); \ No newline at end of file diff --git a/org.framed.iorm.ui/modules/compartment/CompartmentTypes.editpolicy b/org.framed.iorm.ui/modules/compartment/CompartmentTypes.editpolicy index 9ded4a86..d3981d07 100644 --- a/org.framed.iorm.ui/modules/compartment/CompartmentTypes.editpolicy +++ b/org.framed.iorm.ui/modules/compartment/CompartmentTypes.editpolicy @@ -1,31 +1,5 @@ <?xml version="1.0" encoding="ASCII"?> <editpolicymodel:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:editpolicymodel="http://framed/editpolicymodel"> - <policies action="Add" actionType="CompartmentType"> - <featureRule xsi:type="editpolicymodel:NotFeatureRule"> - <rule xsi:type="editpolicymodel:IsFeature" featureName="Compartment_Types"/> - </featureRule> - <constraintRule xsi:type="editpolicymodel:AndConstraintRule"> - <rules xsi:type="editpolicymodel:NotConstraintRule"> - <rule xsi:type="editpolicymodel:InType" type="CompartmentType"/> - </rules> - <rules xsi:type="editpolicymodel:NotConstraintRule"> - <rule xsi:type="editpolicymodel:ContainsCompartment"/> - </rules> - </constraintRule> - </policies> - <policies actionType="CompartmentType"> - <featureRule xsi:type="editpolicymodel:NotFeatureRule"> - <rule xsi:type="editpolicymodel:IsFeature" featureName="Compartment_Types"/> - </featureRule> - <constraintRule xsi:type="editpolicymodel:AndConstraintRule"> - <rules xsi:type="editpolicymodel:NotConstraintRule"> - <rule xsi:type="editpolicymodel:InType" type="CompartmentType"/> - </rules> - <rules xsi:type="editpolicymodel:NotConstraintRule"> - <rule xsi:type="editpolicymodel:ContainsCompartment"/> - </rules> - </constraintRule> - </policies> <policies action="Add" actionType="CompartmentType"> <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Compartment_Types"/> <constraintRule xsi:type="editpolicymodel:NotConstraintRule"> diff --git a/org.framed.iorm.ui/modules/compartment/contains_compartments/ContainsCompartments.ecl b/org.framed.iorm.ui/modules/compartment/contains_compartments/ContainsCompartments.ecl deleted file mode 100644 index 9aed47a5..00000000 --- a/org.framed.iorm.ui/modules/compartment/contains_compartments/ContainsCompartments.ecl +++ /dev/null @@ -1,3 +0,0 @@ -//ContainsCompartments -Add CompartmentType (Contains_Compartments) when InType(CompartmentType); -Create CompartmentType (Contains_Compartments) when InType(CompartmentType); \ No newline at end of file diff --git a/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl b/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl deleted file mode 100644 index aab00a25..00000000 --- a/org.framed.iorm.ui/modules/compartment/inheritance/CompartmentInheritance.ecl +++ /dev/null @@ -1,5 +0,0 @@ -//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/playing_own_roles/PlayingOwnRoles.ecl b/org.framed.iorm.ui/modules/compartment/playing_own_roles/PlayingOwnRoles.ecl deleted file mode 100644 index 16418840..00000000 --- a/org.framed.iorm.ui/modules/compartment/playing_own_roles/PlayingOwnRoles.ecl +++ /dev/null @@ -1,5 +0,0 @@ -//Playing_own_roles -Start Fulfillment (Playable_by_Defining_Compartment) when IsSourceType(CompartmentType); -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/DataTypes.ecl b/org.framed.iorm.ui/modules/datatype/DataTypes.ecl index 10a82f09..ac8fb819 100644 --- a/org.framed.iorm.ui/modules/datatype/DataTypes.ecl +++ b/org.framed.iorm.ui/modules/datatype/DataTypes.ecl @@ -1,3 +1,4 @@ //DataTypes Add DataType (Data_Types) when true; -Create DataType (Data_Types) when true; \ No newline at end of file +Create DataType (Data_Types) when true; +Direct_Edit DataType (true) when true; \ No newline at end of file diff --git a/org.framed.iorm.ui/modules/datatype/DataTypes.editpolicy b/org.framed.iorm.ui/modules/datatype/DataTypes.editpolicy index 3a492f05..c097f9e2 100644 --- a/org.framed.iorm.ui/modules/datatype/DataTypes.editpolicy +++ b/org.framed.iorm.ui/modules/datatype/DataTypes.editpolicy @@ -8,4 +8,8 @@ <featureRule xsi:type="editpolicymodel:IsFeature" featureName="Data_Types"/> <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> </policies> + <policies action="Direct_Edit" actionType="DataType"> + <featureRule xsi:type="editpolicymodel:TrueFeatureRule"/> + <constraintRule xsi:type="editpolicymodel:TrueConstraintRule"/> + </policies> </editpolicymodel:Model> diff --git a/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl b/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl deleted file mode 100644 index 735b2261..00000000 --- a/org.framed.iorm.ui/modules/datatype/inheritance/DataTypeInheritance.ecl +++ /dev/null @@ -1,5 +0,0 @@ -//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(); -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/relationship/Relationship.ecl b/org.framed.iorm.ui/modules/relationship/Relationship.ecl deleted file mode 100644 index 8711b96d..00000000 --- a/org.framed.iorm.ui/modules/relationship/Relationship.ecl +++ /dev/null @@ -1,7 +0,0 @@ -//Relationships -Start Relationship (Relationships) when IsSourceType(RoleType); -Add Relationship (Relationships) when IsTargetType(RoleType) and IsSourceType(RoleType) and !SourceEqualsTarget(); -Reconnect Relationship (Relationships) when IsTargetType(RoleType) and IsSourceType(RoleType) and !SourceEqualsTarget(); -Create Relationship (Relationships) when IsTargetType(RoleType) and IsSourceType(RoleType) and !SourceEqualsTarget(); - -Execute Relationship (Relationships) when true; diff --git a/org.framed.iorm.ui/modules/relationship/inter_relationship_constraints/InterRelationship.ecl b/org.framed.iorm.ui/modules/relationship/inter_relationship_constraints/InterRelationship.ecl deleted file mode 100644 index 6d084323..00000000 --- a/org.framed.iorm.ui/modules/relationship/inter_relationship_constraints/InterRelationship.ecl +++ /dev/null @@ -1,10 +0,0 @@ -//InterRelationship -Start RelationshipExclusion (Inter_Relationship_Constraints) when true; -Add RelationshipExclusion (Inter_Relationship_Constraints) when true; -Reconnect RelationshipExclusion (Inter_Relationship_Constraints) when true; -Create RelationshipExclusion (Inter_Relationship_Constraints) when true; - -Start RelationshipImplication (Inter_Relationship_Constraints) when true; -Add RelationshipImplication (Inter_Relationship_Constraints) when true; -Reconnect RelationshipImplication (Inter_Relationship_Constraints) when true; -Create RelationshipImplication (Inter_Relationship_Constraints) when true; diff --git a/org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/AbstractIntraRelationshipConstraintPattern.java b/org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/AbstractIntraRelationshipConstraintPattern.java index a3eb07e3..8bee86e7 100644 --- a/org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/AbstractIntraRelationshipConstraintPattern.java +++ b/org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/AbstractIntraRelationshipConstraintPattern.java @@ -111,11 +111,19 @@ public abstract class AbstractIntraRelationshipConstraintPattern extends FRaMEDS * @return if the intra relationship constraint can be added */ public boolean canAddIntraRelationshipConstraint(IAddContext addContext, Type type) { - if(addContext.getNewObject() instanceof Relation) { - Relation relation = (Relation) addContext.getNewObject(); - if(relation.getType() == type) { - return EditPolicyService.getHandler(this.getDiagram()).canAdd(addContext, type); - } } + if (addContext.getNewObject() instanceof Relation) { + Relation relation = (Relation) addContext.getNewObject(); + if (relation.getType() == type) { + Connection targetConnection = addContext.getTargetConnection(); + if (targetConnection != null) { + Object m = getBusinessObjectForPictogramElement(targetConnection); + if (m instanceof Relation && ((Relation) m).getType() == Type.RELATIONSHIP) { + // TODO: Create EditPolicy rule for this case + return EditPolicyService.getHandler(this.getDiagram()).canAdd(addContext, type); + } + } + } + } return false; } diff --git a/org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/IntraRelationship.ecl b/org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/IntraRelationship.ecl deleted file mode 100644 index 0de8445a..00000000 --- a/org.framed.iorm.ui/modules/relationship/intra_relationship_constraints/IntraRelationship.ecl +++ /dev/null @@ -1,20 +0,0 @@ -//IntraRelationshipConstraint -Add Irreflexive (Intra_Relationship_Constraints) when true; -Start Irreflexive (Intra_Relationship_Constraints) when true; -Create Irreflexive (Intra_Relationship_Constraints) when true; - -Add Acyclic (Intra_Relationship_Constraints) when true; -Start Acyclic (Intra_Relationship_Constraints) when true; -Create Acyclic (Intra_Relationship_Constraints) when true; - -Add Cyclic (Intra_Relationship_Constraints) when true; -Start Cyclic (Intra_Relationship_Constraints) when true; -Create Cyclic (Intra_Relationship_Constraints) when true; - -Add Reflexive (Intra_Relationship_Constraints) when true; -Start Reflexive (Intra_Relationship_Constraints) when true; -Create Reflexive (Intra_Relationship_Constraints) when true; - -Add Total (Intra_Relationship_Constraints) when true; -Start Total (Intra_Relationship_Constraints) when true; -Create Total (Intra_Relationship_Constraints) when true; diff --git a/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.ecl b/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.ecl deleted file mode 100644 index 71e55777..00000000 --- a/org.framed.iorm.ui/modules/roletype/group_constraints/RoleGroup.ecl +++ /dev/null @@ -1,3 +0,0 @@ -//groupConstraints/RoleGroup -Add RoleGroup (Group_Constraints) when InType(CompartmentType); -Create RoleGroup (Group_Constraints) when InType(CompartmentType); \ No newline at end of file diff --git a/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl b/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl deleted file mode 100644 index a4ef4808..00000000 --- a/org.framed.iorm.ui/modules/roletype/inheritance/RoleInheritance.ecl +++ /dev/null @@ -1,5 +0,0 @@ -//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(); -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/role_constraints/RoleConstraints.ecl b/org.framed.iorm.ui/modules/roletype/role_constraints/RoleConstraints.ecl deleted file mode 100644 index 21169077..00000000 --- a/org.framed.iorm.ui/modules/roletype/role_constraints/RoleConstraints.ecl +++ /dev/null @@ -1,15 +0,0 @@ -//RoleConstraints -Start RoleImplication (Role_Implication) when IsSourceType(RoleType); -Add RoleImplication (Role_Implication) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType(); -Reconnect RoleImplication (Role_Implication) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType(); -Create RoleProhibition (true) when true; - -Start RoleEquivalence (Role_Equivalence) when IsSourceType(RoleType); -Add RoleEquivalence (Role_Equivalence) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType(); -Reconnect RoleEquivalence (Role_Equivalence) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType(); -Create RoleProhibition (true) when true; - -Start RoleProhibition (Role_Prohibition) when IsSourceType(RoleType); -Add RoleProhibition (Role_Prohibition) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType(); -Reconnect RoleProhibition (Role_Prohibition) when IsSourceType(RoleType) and !SourceEqualsTarget() and SourceEqualsTargetType(); -Create RoleProhibition (true) when true; \ No newline at end of file -- GitLab