Author Topic: How to distribute my scripts to others  (Read 13012 times)

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
How to distribute my scripts to others
« on: November 17, 2015, 12:50:34 pm »
The document (Introduction to Scripts) states 'Scripts are stored with the model and are organized using Groups.', therefore, I thought my added scripts would have been stored in the repository and others can see them immediately or after 'Reload Project'. However, others could not see them and it appears the scripts are stored locally within the SPARX client.

I can't see any script export/import options available. What is the best way to distribute my scripts for others to use, other than manually adding each empty script and then copy/paste the content by others?

Your advise is very much appreciated.

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile
Re: How to distribute my scripts to others
« Reply #1 on: November 17, 2015, 01:02:59 pm »

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: How to distribute my scripts to others
« Reply #2 on: November 17, 2015, 01:22:34 pm »
Thank you VKN for your promptly and helpful response. I have now managed to export the automation scripts that I assume including mine.

It appears I don't have the permission to 'Import Reference Data' as its feature greyed out. I gather most my colleagues would have the same permission issue. Wondering why this import to the client side (as I would assume) would need access control.

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: How to distribute my scripts to others
« Reply #3 on: November 17, 2015, 01:37:09 pm »
I gather the scripts are stored with the data model within the repository however under each user's workspace!?

I reckon the export/import reference data is designed for the movement between projects. I would expect there is an option for me to set my scripts to be 'shared' so others working on the same project can see them!

VKN

  • EA User
  • **
  • Posts: 187
  • Karma: +9/-1
    • View Profile
Re: How to distribute my scripts to others
« Reply #4 on: November 17, 2015, 01:48:58 pm »
Did your colleagues try restarting EA then connect to the project?

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: How to distribute my scripts to others
« Reply #5 on: November 17, 2015, 01:52:02 pm »
No. Had only tried 'Reload Project' that I would have expected the same effect...

Will ask my colleagues to try to restart...

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: How to distribute my scripts to others
« Reply #6 on: November 17, 2015, 02:19:44 pm »
Thank you VKN for your suggestion.

After restarting EA, my colleagues can see the scripts without importing. It seems 'Reload Project' does not reload all the project data!?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13241
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to distribute my scripts to others
« Reply #7 on: November 17, 2015, 02:44:12 pm »
There a special Refresh Script Tree button in the scripting view that you can use to reload the scripts

Geert

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: How to distribute my scripts to others
« Reply #8 on: November 17, 2015, 02:59:06 pm »
Thank you Geert for another useful tip.

I found out the refresh does work if the scripts are not present, however, if the scripts have been deleted or renamed, the refresh would not update the list and one could still see the deleted or renamed scripts that had been loaded earlier until restarting EA or close project and reconnect.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13241
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to distribute my scripts to others
« Reply #9 on: November 17, 2015, 03:32:48 pm »
Quote
I found out the refresh does work if the scripts are not present, however, if the scripts have been deleted or renamed, the refresh would not update the list and one could still see the deleted or renamed scripts that had been loaded earlier until restarting EA or close project and reconnect.
That is really weird.
I would report that as a bug. I'm sure that's something they can quickly fix.

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to distribute my scripts to others
« Reply #10 on: November 17, 2015, 10:53:06 pm »
Hello,

Quote
The document (Introduction to Scripts) states 'Scripts are stored with the model and are organized using Groups.'
Pardon me, but what document is this? Is it in the help file, a Sparx white paper, or something from a third party? I really do want to know, because that quote seems wrong to me.

The best way of distributing scripts is to package them into an MDG Technology. This is how Sparx does it with their EAScriptLib.

With an MDG Technology, the scripts are not bound to any particular project. They are stored in a file and can be used freely in any project.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13241
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to distribute my scripts to others
« Reply #11 on: November 18, 2015, 03:28:05 am »
Doesn't seem wrong to me.
If I write a script it is stored in the model and organised in groups no?

You have a point with regards to the distribution, but a big downside is that from an MDG file you get all scripts in one single standard group.
So you can't use the scripts context menu's to execute scripts (unless there's a hidden passage way I haven't discovered yet)

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to distribute my scripts to others
« Reply #12 on: November 18, 2015, 11:30:42 pm »
Quote
Doesn't seem wrong to me.
If I write a script it is stored in the model and organised in groups no?
When you write it, yes. But not necessarily when you use it (could be in an MDG Technology). Plus, if you save a script from the editor it gets written to disk. So the statement is incomplete or, using a couple fewer letters, wrong. :)
And since this is a deployment issue, both the writing side and the using side are important.

Quote
You have a point with regards to the distribution, but a big downside is that from an MDG file you get all scripts in one single standard group.
So you can't use the scripts context menu's to execute scripts (unless there's a hidden passage way I haven't discovered yet)
No, I haven't found one either. But it wasn't clear from the OP that this was a requirement. Which is part of the reason I asked about the source of the incorrect information he or she has been working from: if there are more errors in that document, then clearing those up might help.

/Uffe
My theories are always correct, just apply them to the right reality.

peigee

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: How to distribute my scripts to others
« Reply #13 on: November 19, 2015, 12:11:14 pm »
The content that I had quoted is from the following document file distributed as part of EA12.0.1210 client program:

...\ProgramFilesX86\Sparx Systems\EA\Books\Automation\Scripting\Introduction to Scripts.rtf

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to distribute my scripts to others
« Reply #14 on: November 19, 2015, 08:29:03 pm »
Hi again,

Quote
The content that I had quoted is from the following document file distributed as part of EA12.0.1210 client program:

...\ProgramFilesX86\Sparx Systems\EA\Books\Automation\Scripting\Introduction to Scripts.rtf
Oh dear. Well I'd definitely call that plain wrong an over-simplification.

I explained the different storage locations in my answer to this SO question the other year. In brief, scripts can be used from the EA installation directory ("Local scripts"), from within the project itself, and from an MDG Technology.

In order to distribute scripts, you can use the Model Import/Export functions under the Project menu; importing a script this way will store it in the project, and if you want to make any changes you have to run the export/import cycle again.

An MDG Technology is an XML file, just like the result of a reference data export. The difference is that an MDG Technology can contain more than one type of thing, eg scripts, UML profiles, and document templates.

Using an MDG Technology, you can make your scripts available to the users regardless of which project they happen to be in, if they configure their EA clients to look for MDG Technologies in a shared directory. They only need to do this once. Subsequent updates requires them to restart EA (or deselect / reselect the MDG Technology, which is too complicated for some users).

It gets a little more complicated by the fact that an MDG Technology itself can also be imported to a project, or to a user's installation directory. Don't do that, use a shared directory instead.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.