Book a Demo

Author Topic: Behavior editor  (Read 4913 times)

royvanmarrewijk

  • EA User
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Behavior editor
« on: April 22, 2016, 08:16:53 pm »
Hi,

For the description of the behavior we are currently using the behavior field within an operation of a SysML1.3::Block. Because the editor of the behavior field isn't that well I am wondering what the alternatives are. I already tried to use the initial code field so we can at least have some tabs and colors but what I really would like to have is a possibility to edit my code in for example Notepad++. Within Notepad++ it would be nice if we have the possibility to have all the operations in one view.

So can someone tell me what's the best way for describing the behavior of operations?
Roy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Behavior editor
« Reply #1 on: April 22, 2016, 08:51:22 pm »
I once wrote a fairly simply add-in that would export the contents the the postcondition into a textfile and open that in Notepad++.
We used that to write pseudo code to describe the behavior of operations, so I could make syntax highlighting file for our peudo code.
The add-in also had a file system listener that noticed when the file had been saved in Notepad++ and asked the user if the code needed to be saved in EA.

Geert

royvanmarrewijk

  • EA User
  • **
  • Posts: 61
  • Karma: +1/-0
    • View Profile
Re: Behavior editor
« Reply #2 on: April 25, 2016, 05:09:44 pm »
Hi Geert,

Thanks for your quick reaction!
Would you like to share your add-in or do you have some document like 'Develop EA add-ins for Dummies'?

Kind regards,
Roy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Behavior editor
« Reply #3 on: April 25, 2016, 09:39:56 pm »
Hi Roy,

I don't own the rights to that code, so I won't be able to share it, but I did write a bunch of articles about writing add-ins for EA: https://bellekens.com/writing-ea-add-ins/

Basically what the add-in did was add a context menu item for operations, and when clicked write the contents of the postcondition to a temp directory.
The name of the file was the <operationID>.<PostconditionName>.postcondition.
Then we told Windows to always open files with extension .postcondition with Notepad++
That allowed to me just tell the system to open that file. Because of the link between the extension and Notepad++ the correct application would be launched.

The file system watcher was also something I found pretty easily on google. The only tricky thing I remember was that it somehow triggered twice when a file was saved, or it triggered when the file was only halve saved, so I had to build in some kind of wait loop or something to make sure the file was actually completely saved.

All in all it took me less then two days to build that add-in.

Geert