Book a Demo

Author Topic: DB Trigger item - Does it exist?  (Read 4436 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
DB Trigger item - Does it exist?
« on: October 28, 2020, 11:51:03 am »
We are investigating extending the standard data(base) modelling to overlay the shapescripts with additional functionality.

Specifically, we are looking at SQL Server.  When we create a pattern structure from the available patterns (in this case "Basic SQL Server 2012 Model") we get the following structure:

Database A
Functions
Procedures
Queries
Sequences
Triggers
Tables
Views
Connections

When we reverse engineer using DB Builder, the appropriate folder is populated with the appropriate component type.
The Data Modelling Toolbox shows items for all the above EXCEPT for "Triggers".  None of our DBs (that we have reverse engineered) so far have used triggers so we can't see what EA uses after the reverse engineer.  Does anybody know if there is a separate stereotype for the Trigger?

TIA,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Richard Freggi

  • EA User
  • **
  • Posts: 498
  • Karma: +18/-7
    • View Profile
Re: DB Trigger item - Does it exist?
« Reply #1 on: October 28, 2020, 11:59:21 am »
Yes, the stereotype is right there in Configure - UML types menu.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: DB Trigger item - Does it exist?
« Reply #2 on: October 28, 2020, 03:55:27 pm »
Yes, the stereotype is right there in Configure - UML types menu.
Thanks, Richard,
But the one I'm after is the EAUML::xxxxx version as the Data Modelling stuff is now held in the EAUML profile.  It doesn't seem to be there.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: DB Trigger item - Does it exist?
« Reply #3 on: October 29, 2020, 08:05:19 am »
Yes, there is a stereotype EAUML::trigger that extends UML::Operation. I don't know why it isn't in the toolbox - maybe there's a "correct" way to create them and dropping from the toolbox isn't it? A quick support request should get you an answer.
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: DB Trigger item - Does it exist?
« Reply #4 on: October 29, 2020, 09:15:01 am »
Yes, there is a stereotype EAUML::trigger that extends UML::Operation. I don't know why it isn't in the toolbox - maybe there's a "correct" way to create them and dropping from the toolbox isn't it? A quick support request should get you an answer.
Thanks, Neil,

I'll pop in a request.  Now that you say it's based on Operation, that would explain why I couldn't see it in the dropdowns.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: DB Trigger item - Does it exist?
« Reply #5 on: October 29, 2020, 11:49:10 am »
I tried to create a Database trigger (as opposed to a table related trigger).  DB builder didn't see it.  Does anyone know if it is supported?

TIA,
Paolo

Trivial example (in case you've never seen a Database trigger):
Code: [Select]
CREATE TRIGGER MyDBTrigger ON DATABASE
FOR ALTER_TABLE
AS
IF IS_MEMBER ('db_owner') = 0
BEGIN
   PRINT 'You must ask your DBA to drop or alter tables!'
   ROLLBACK TRANSACTION
END
GO
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: DB Triggers - why a folder for them?
« Reply #6 on: October 29, 2020, 12:57:27 pm »
I tried to create a Database trigger (as opposed to a table related trigger).  DB builder didn't see it.  Does anyone know if it is supported?

[SNIP]

As I mentioned in the original post, there is a folder for Triggers.  As KP mentioned, table level triggers are specialized operations which are located within the table item.  Consequently, they can't appear in their own folder.

I surmise that the Triggers folder is for database-level triggers which are first-class DB objects in their own right.  Accordingly, since (currently - b1554) DBBuilder doesn't see them, should the folder be retained (to allow for the defect to the rectified) or should we delete it from the "pattern"?

I'm asking because we are finalising our new strategy for Database modelling within the organisation and I'd welcome input before we "lock the door".

TIA,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: DB Trigger item - Does it exist?
« Reply #7 on: November 03, 2020, 12:27:58 pm »
Reported,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!