View Issue Details

IDProjectCategoryView StatusLast Update
0001523CaseTalk ModelerGeneration (SQL, XML, etc)public2022-01-10 20:40
ReporterBCP Software Assigned ToBCP Software  
PrioritynormalSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
Target Version8.28Fixed in Version8.27 
Summary0001523: Generator mistakenly creates subset constraints as foreign key relationships
DescriptionThe error shows when the Powerdesigner plugin confuses relationships and creates subset constraints as subtype relationships.
Also SQL DDL shows regular foreign keys back tot the child table, where it should've been a subset constraint.
TagsNo tags attached.
CaseTalk Edition

Relationships

related to 0001525 closedBCP Software CaseTalk Modeler Promote the SC hack to storage 

Activities

BCP Software

BCP Software

2017-11-17 10:06

administrator   ~0001045

Now that CaseTalk warns the user it cannot determine to which way a binary fact type (with two seperate uc's) should be grouped, and therefor leaves it as is, a problem arises. Since tables require a primary key on either one, one of the UC's will be dominant and become primary key.

In addition: When both roles contain a Totality Constraint, a series of subsets will be generated. Some of these subsets will define regular foreign keys, and some will generate regular subsets to reflect the transformed TC. Now when generating a script which actually supports subtype relationships (such as CDM in PowerDesigner), the script is generated faulty, since we can no longer determine what the generated SC's should represent. Which is the foreign key, which is the subtype/supertype, and which is a regular subset constraint?

Some indication should be stored with the SC to indicate the function it replaces during GLR.
BCP Software

BCP Software

2017-11-17 10:09

administrator   ~0001046

The conceptual starting point. Where all roles are specified as "do not group" to force the error to appear.
ig.png (21,724 bytes)   
ig.png (21,724 bytes)   
BCP Software

BCP Software

2017-11-17 10:11

administrator   ~0001047

Last edited: 2017-11-17 10:11

After GLR, the diagram will show as this. The SC's themselves are not clearly defined. Therefor a well defined scripts cannot be generated for PowerDesigner.

igg.png (12,258 bytes)   
igg.png (12,258 bytes)   
BCP Software

BCP Software

2017-11-17 22:46

administrator   ~0001048

Last edited: 2017-11-17 22:51

The SQL92 script shows an error too:

...
-- subtype relationship
ALTER TABLE "MICRO_TOPO_LINEAIR_OBJECT"
   ADD FOREIGN KEY ("LINEAIR_OBJECT_FUNCTIONEEL_OBJECT")
   REFERENCES "LINEAIR_OBJECT" ("INFRA_OBJECT_FUNCTIONEEL_OBJECT");

-- foreign key
ALTER TABLE "MICRO_LINK_VERVULLER"
   ADD FOREIGN KEY ("MICRO_LINK")
   REFERENCES "MICRO_LINK" ("LINK");

-- subset constraint
ALTER TABLE "MICRO_LINK"
   ADD CHECK ("LINK" 
      IN (SELECT "MICRO_LINK" FROM "MICRO_LINK_VERVULLER"));

-- foreign key
ALTER TABLE "MICRO_LINK_VERVULLER"
   ADD FOREIGN KEY ("MICRO_TOPO_LINEAIR_OBJECT_FUNCTIONEEL_OBJECT")
   REFERENCES "MICRO_TOPO_LINEAIR_OBJECT" ("LINEAIR_OBJECT_FUNCTIONEEL_OBJECT");

-- This should be a subset and not a regular foreign key
ALTER TABLE "MICRO_TOPO_LINEAIR_OBJECT"
   ADD FOREIGN KEY ("LINEAIR_OBJECT_FUNCTIONEEL_OBJECT")
   REFERENCES "MICRO_LINK_VERVULLER" ("MICRO_TOPO_LINEAIR_OBJECT_FUNCTIONEEL_OBJECT");

...

CaseTalk cannot distinguish subset constraints from regular foreign keys. It tries to determine that from the structures. If a subset refers to a uc which is also marked to be primary key, it assumes it is a regular foreign key, instead of a subset constraint. However since tables require a primary key, some uc's are promoted to become one. And in these cases the formerly known subset gets determined to become a foreign key.

Therefor the SC needs an extension to mark the SC to be a FK or a regular SC.

BCP Software

BCP Software

2017-11-19 17:13

administrator   ~0001049

An internal hack created a fix by using the SC comments internally. A future release will contain a more structured storage for this, extending SC with an additional column specifying wether it originated from a transformed TC or from a grouped Role.
BCP Software

BCP Software

2022-01-10 20:40

administrator   ~0003341

Closing automatically, stayed too long in resolved state. Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2017-11-16 14:36 BCP Software New Issue
2017-11-16 14:36 BCP Software Status new => assigned
2017-11-16 14:36 BCP Software Assigned To => BCP Software
2017-11-17 09:54 BCP Software Issue cloned: 0001524
2017-11-17 10:06 BCP Software Note Added: 0001045
2017-11-17 10:09 BCP Software File Added: ig.png
2017-11-17 10:09 BCP Software Note Added: 0001046
2017-11-17 10:11 BCP Software File Added: igg.png
2017-11-17 10:11 BCP Software Note Added: 0001047
2017-11-17 10:11 BCP Software Note Edited: 0001047
2017-11-17 22:46 BCP Software Note Added: 0001048
2017-11-17 22:47 BCP Software Note Edited: 0001048
2017-11-17 22:51 BCP Software Note Edited: 0001048
2017-11-18 11:04 BCP Software Target Version 8.27 => 8.28
2017-11-18 11:08 BCP Software Summary Powerdesigner creates subset constraints as subtype relationships => Generator mistakenly creates subset constraints as foreign key relationships
2017-11-18 11:08 BCP Software Description Updated
2017-11-19 17:13 BCP Software Status assigned => resolved
2017-11-19 17:13 BCP Software Resolution open => fixed
2017-11-19 17:13 BCP Software Fixed in Version => 8.27
2017-11-19 17:13 BCP Software Note Added: 0001049
2017-11-19 17:14 BCP Software Relationship added related to 0001525
2022-01-10 20:40 BCP Software Note Added: 0003341
2022-01-10 20:40 BCP Software Status resolved => closed