ok... it's been refined slightly. But I'm having huge problems modeling certian constraints.
INFO: activities have a type dictated by a letter (A/B/C/D). This is constant throughout all processes.
the constraint is:
certian activities cannot be linked - activity D cannot follow activity A.
------------and---------------->activity B and activity C cannot be linked at all
So is either of the red or the blue correct. Ignoring most else for now. I hate subtyping but to me it makes sence. Duno if it makes sence to anyone else.
SO- according to the constrain above
A can follow B, C and D
B can follow A and D
C can follow A and D
D can follow B and C
assuming my understand of subtyping is correct (that subtypes inherit the same fact types as their parent) and the following subtyping is allowed (legal in ORM worlds) then it "should" work out. hoepfully.
Thanks alot for your help
ps- if you're wondering. This is for uni. But I'm not asking you to DO my work rather asking if certain aspects of it are aceptable to knowledgable people such as yourselves.
I think that you are looking for one main table, process_activity, that has the process, activity, sequence information.
Of course, you will have tables for describing each of "process", "activity", etc.
Additionally, to impose the constraint on successor activities, you can have a table called, say, next_activity_type, with the following columns:
(current_activity_type, next_allowed_activity_type, ...)
Write a small procedure (trigger) to validate that the activites in the main table (process_activity) obey these constraints.
That should take care of this problem.
There is no need for types and sub-types here. As an aside, in the OO world, types and sub-types are heavily mis-used.
This is the closest relevant forum I could think of since ORM is one of the first stages of database design. and yes... orm is object role modeling/mapping (I guess i shouldn't say orm modeling. Kinda like saying ATM machine). If you think it belongs in another forum please tell me so I can get an admin to move it.