Skip to content

Commit 8ef8e3f

Browse files
author
Open Lowcode SAS
committed
Adding LinkObject property in Open Lowcode designer (module still draft
and incomplete)
1 parent 816d973 commit 8ef8e3f

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

src/org/openlowcode/module/designer/design/DesignerModule.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ public DesignerModule() {
9797
propertytype.addValue(PROPERTY_UNIQUEIDENTIFIED);
9898
ChoiceValue PROPERTY_LINKEDTOPARENT = new ChoiceValue("LINKEDTOPARENT","Linked to Parent","Links to exactly one object of the parent type.");
9999
propertytype.addValue(PROPERTY_LINKEDTOPARENT);
100+
ChoiceValue PROPERTY_LINKOBJECT = new ChoiceValue("LINKOBJECT","Link Object","A property to be added .");
101+
propertytype.addValue(PROPERTY_LINKOBJECT);
100102

101103
this.addChoiceCategory(propertytype);
102104

@@ -117,11 +119,27 @@ public DesignerModule() {
117119
DataObjectDefinition mainlink = new DataObjectDefinition("MAINLINK","Main Link",this);
118120
mainlink.addProperty(new StoredObject());
119121
mainlink.addProperty(new UniqueIdentified());
120-
LinkObject linkobject = new LinkObject(property,object,"Main Object","Referenced as main object by");
121-
linkobject.addBusinessRule(new ConstraintOnLinkTypeRestrictionForLeft(new ChoiceValue[] {PROPERTY_LINKEDTOPARENT}));
122-
linkobject.addBusinessRule(new ConstraintOnLinkMaxOneFromLeft(linkobject, true));
123-
linkobject.addBusinessRule(new DisplayLinkAsAttributeFromLeftObject(true));
124-
mainlink.addProperty(linkobject);
122+
123+
LinkObject linkobjectformainlink = new LinkObject(property,object,"Main Object","Referenced as main object by");
124+
linkobjectformainlink.addBusinessRule(new ConstraintOnLinkTypeRestrictionForLeft(new ChoiceValue[] {PROPERTY_LINKEDTOPARENT,PROPERTY_LINKOBJECT}));
125+
linkobjectformainlink.addBusinessRule(new ConstraintOnLinkMaxOneFromLeft(linkobjectformainlink, true));
126+
linkobjectformainlink.addBusinessRule(new DisplayLinkAsAttributeFromLeftObject(true));
127+
mainlink.addProperty(linkobjectformainlink);
128+
129+
DataObjectDefinition twolinksproperty = new DataObjectDefinition("TWOLINKSPROPERTY","Two link property",this);
130+
twolinksproperty.addProperty(new Stored());
131+
twolinksproperty.addProperty(new HasId());
132+
twolinksproperty.addProperty(new Companion(property, new ChoiceValue[] {PROPERTY_LINKOBJECT}));
133+
134+
DataObjectDefinition secondarylink = new DataObjectDefinition("SECONDLINK","Secondary Link",this);
135+
secondarylink.addProperty(new StoredObject());
136+
secondarylink.addProperty(new UniqueIdentified());
137+
138+
LinkObject linkobjectforsecondlink = new LinkObject(property,object,"Second Object","Referenced as second object by");
139+
linkobjectforsecondlink.addBusinessRule(new ConstraintOnLinkTypeRestrictionForLeft(new ChoiceValue[] {PROPERTY_LINKOBJECT}));
140+
linkobjectforsecondlink.addBusinessRule(new ConstraintOnLinkMaxOneFromLeft(linkobjectforsecondlink, true));
141+
linkobjectforsecondlink.addBusinessRule(new DisplayLinkAsAttributeFromLeftObject(true));
142+
secondarylink.addProperty(linkobjectforsecondlink);
125143
}
126144

127145
}

0 commit comments

Comments
 (0)