Book a Demo

Author Topic: prevent operation(method) name change  (Read 3411 times)

Danny F

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
prevent operation(method) name change
« on: December 12, 2012, 10:28:32 pm »
Questions, questions, questions ......... I know ........

I'm trying to prevent the change of an existing operation on an element.

I prevent the creation of a new one using the EA_OnPreNewMethod(...)
That works OK

However, existing operations cannot be changed by the user  !
(more particular, for the moment,  the name and stereotype)

I'm at a loss ...

Related question : is there a way to interact with the EA dialogs ??
(disabling buttons, ....) ?

thanks again




« Last Edit: December 12, 2012, 10:29:36 pm by dannyf »
Reg.

Danny

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: prevent operation(method) name change
« Reply #1 on: December 12, 2012, 11:25:50 pm »
Danny,

You can't disable things like buttons in EA dialogs.

You can prevent the deletion of things, but you can't really prevent changing things.
You can only react right after the change has taken place to undo the changes

In you case I would:
  • Use EA_OnContextItemChanged to record the details of your operation
  • Use EA_OnNotifyContextItemModified to compare the details of the operation with the recorded details, and change them back if necessary.

Geert

Danny F

  • EA User
  • **
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: prevent operation(method) name change
« Reply #2 on: December 13, 2012, 12:16:07 am »
Thanks Geert

The combination with EA_OnContextItemChanged does the trick  :)

Neat things possible in EA but jumping through hoops etc necessary
Seems to me a lot of potential is left out there...........

Continuing .......... 8-)

gr
Reg.

Danny

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: prevent operation(method) name change
« Reply #3 on: December 13, 2012, 01:11:37 am »
Danny,

You are absolutely right. Prepare to jump some more...

But from time to time we get something new from Sparx opening up some possibilities.

Like the events, they haven't been around all that long...

Geert