Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ZuluTen

Pages: [1] 2 3 4
1
General Board / Scripts and Custom Tables - How to Edit and Run
« on: November 07, 2025, 01:33:30 am »
I am completely confused by the use of a script with a Custom Table, and wonder whether someone might please explain:

I have added a CustomTable to a diagram.

I can then, as per the manual, press Ctrl-Alt-7 whereupon a ‘child’ element titled “script()” appears in the Project Browser under the CustomTable. I can drop in some JavaScript, and save it.

Then following the manual (yes, foolish I know), I close the script editing tab, and revert to the diagram upon which the Custom Table is shown.

The manual actually says "If an associated script has been defined for the table, it can be run by right-clicking the table while it is not in edit mode then choosing the option 'Run Custom Table Script'." but I can see no such menu item. Instead, there is  a “Execute Behaviour Script” option, but it is greyed out.

Consequently I can see no way to run the script.

Now, by taking a different approach, and generating a fresh Custom Table:

If I right click on the Custom Table in the  Project Browser:, and follow “Features” I am offered the options to “Edit Behaviour” and “Edit Internal Code.”

When I select Edit Internal Code I am presented with a new tab that shows the parent Custom Table, with beneath (i.e. subservient) it “Internal Code”, and beneath that “Code” and “script”.

When I put something in this ‘new’ version of script, save and close it, then the “Execute Behaviour Script” command is no longer greyed out, and can be actioned (I think).

However, having done that, the code snippet that I dropped in using the second editing technique is not visible using the first technique, and vice versa.

Can someone please explain to me why there are apparently two different script receptacles, and what, if anything, should go in code?

Many thanks

BTW: I've tried this on different machines, with both v16.1 and v17.1 and am seeing the same result.

2
Up until now, all my EA scripting has been done in VB, but with the advent of Scriptlets I thought that I should move to JavaScript, and in my laziness, and prompted by Ian's post I thought "let's ask Chat GPT to write some of the code..."

The results are fascinating: it has quite confidently generated the code, but included lines such as this:

var diags = Repository.GetDiagramsByName(name);

....which would be admirable if the Repository class actually provided a "GetDiagramsByName" method. Unfortunately there is only GetDiagramByID and GetDiagramsByGUID, so it seems that ChatGPT has simply invented its own method!

It was quick to apologise once I pointed out, but doesn't inspire confidence.

3
This must be the simplest question ever posted, for which I feel mildly embarrassed, but not too embarrassed to ask publicly:

I’ve come to terms (ish) with the vagaries of the RTF report generator, but now need to create an HTML model and place it in Sharepoint for review by various stakeholders.

Strangely the export to Sharepoint was the easy bit, once we realised that replacing the letters html with aspx in the File Extension field of the 'Publish as HTML' window made everything work seamlessly.

However, what I now want to do is have a text string displayed in the header of every web page, to convey a commercial sensitivity caveat to remind all viewers. Sadly Sharepoint permissions are not considered sufficient.

There doesn't seem to be a lot of information on the web about how to modify the Web Style Templates, other than playing with the logo, and if all else fails I shall cheat by amending the logo to carry the caveat text.

Anyway, I have found my way to Resources > Web Style Templates and can generate my own HTML template by copying the default one, but am utterly bewildered by where to define header text within the plethora of fields available.

I've used the examine html facility in the browser of an exported html page to find areas called IndexTitle and IndexHeader but am unsure how/where I can add a constant string to them.

Can anyone please help?

Many thanks

4
Bugs and Issues / Re: This is the only sub forum where I can post...
« on: February 18, 2022, 07:16:22 pm »
Thanks Gentlemen.

Time for Plan B...

5
Bugs and Issues / Re: This is the only sub forum where I can post...
« on: February 16, 2022, 05:15:47 am »
Yes, your book is exactly where I started, and tested out an amended version of your script which works perfectly for those elements which have children, and can return the 'Ref ID' Tagged Value of any child element.

Unfortunately, when the code is run as main, so that the element shape script is looking at its own Tagged Value, nothing happens.

So this works:

shape ChildElement{
   DrawNativeShape();
   SetCompartmentName("Reference");
   AppendCompartmentText("#TAG:Ref ID#");
   }

...but isn't what I want, whereas this doesn't:

shape Main{
   DrawNativeShape();
   SetCompartmentName("Reference");
   AppendCompartmentText("#TAG:Ref ID#");
   }

6
Bugs and Issues / Re: This is the only sub forum where I can post...
« on: February 15, 2022, 10:51:26 pm »
Thank you, but sadly  that doesn't work: the name of my new compartment isn't visible amongst the 'Show Element Compartments' list in the Compartment Visibility window for a newly created element.

Also, when I altered my shape script to call up the tagged values for child elements, I saw the results immediately, without having to modify visibility settings, so suspect that there's something else going on.


7
Bugs and Issues / Re: This is the only sub forum where I can post...
« on: February 15, 2022, 10:03:24 pm »
shape Main{
   DrawNativeShape();
   SetCompartmentName("Reference");
   AppendCompartmentText("#TAG:Ref ID#");
   
}

8
Bugs and Issues / Re: This is the only sub forum where I can post...
« on: February 15, 2022, 09:55:11 pm »
Ah...interesting.

So I have tried to sterilise my post by going through MS Notepad but still have same problem.

I'll now summarise my question by typing direct into here:

I have a custom MDG stereotype element which has ten tagged values.

On a diagram, to declutter, I would like to see only one of the values whose name is Ref ID.

I have used a shape script to define a procedure called Main and in there are two instructions to set compartment name and then append compartment text. Oh and a draw native shape.

Unfortunately I can not see my tagged value.

If I change the name of main to child element, then I see the tagged value for the associated children, so I am confident that the code is picking up the correct value.

Have I missed something obvious about why the shape script is not picking up the value of its own tagged value?

Many thanks.

9
Bugs and Issues / Re: This is the only sub forum where I can post...
« on: February 15, 2022, 09:32:39 pm »
Yes, you're right it's content related, but the only characters were
apostrophe '
inverted commas "
semi-colon ;
full colon:
hyphen -
hash #
brackets ()
square brackets []
curved brackets {}

So why did it get upset, and just out of interest, how did you manage to include guillemets?

...and why has it permitted me to post this message, but refused my original?

10
Bugs and Issues / Re: This is the only sub forum where I can post...
« on: February 15, 2022, 09:26:03 pm »
Thanks for the suggestion.

My next post to this sub-forum will be my original question, in its original form, so let's see what happens.

If there isn't a next post then, yes, it's content related.

11
Bugs and Issues / This is the only sub forum where I can post...
« on: February 15, 2022, 08:57:30 pm »
This is about a bug on this Board rather than in EA:

Whenever I try to post in the Automation Interface, Add-Ins and Tools sub-forum I receive this message:
"Database Error
Please try again. If you come back to this error screen, report the error to an administrator."


Unfortunately I can't see a means of contacting an admin, so am posting here.

Does anyone know why, after 40+ posts in the past, I am apparently barred?

Thanks

12
Am I being stupid?

No


Am I missing something obvious?


There are two kinds of pattern. You are creating a diagram pattern; what you need is a model wizard pattern. Create a roadmap diagram in a package, export the package as XMI, then add a <ModelTemplates> section to your technology to point the model wizard at your XMI file. Here's the help page:

https://sparxsystems.com/enterprise_architect_user_guide/15.2/modeling/model_templates2.html

Ah ha. Many thanks for explaining the difference.

I ran through the process and as you say that makes perfect sense, and despite having to edit the .mts file manually, is quite straightforward, but...it means that I end up with a new package, as well as a new Roadmap diagram.

Is there a way to just get the new pre-formatted diagram without the associated package?

What I mean is that when, inside a package, I select 'Add Diagram' and amongst the menu options are the diagrams contained in my MDG's <<diagram profile>>, is it possible for one of them to be generated with Roadmap Enabled=True and Use Legend For Phase Colours = True having been pre-selected?

13
You may need a pattern to pull that off.

Geert

Thank you for the suggestion.

I've wasted spent all of Sunday morning trying to crack this and am getting nowhere:

Am I being stupid?

My imported pattern does contain the project (object) element, my note from the original diagram, and the legend.

Unfortunately, unlike the original diagram from which the pattern was published, the roadmap enabled flag doesn't get asserted, so the timeline doesn't get automatically displayed. Also the "Use Legend for Phase Colors" doesn't get set either.

Am I missing something obvious?

Thanks

14
I am building a bespoke MDG Technology.

I have previously built a number of MDGs so am happy with the process.

To get a standard Class diagram within my MDG I have a package <<diagram profile>> within which is a stereotype of <<my_diagram_name>> that extends to a metaclass named "Diagram_Logical".

That is all quite successful.

However, I need to include a roadmap diagram, i.e. a Class diagram where as soon as it is instantiated, it automatically has the roadmap timeline displayed at the top, and a pre-defined Legend displayed on the diagram. Better still if there are a couple of horizontal swimlanes.

Doing this all manually is obviously straightforward, but I need a novice user to be presented with the arranged diagram.

I cannot figure out (a) if it is possible, and (b) which attributes I should set either in the stereotype or the metaclass to make this happen.

Can anyone help, please?

Many thanks in advance.

--------------------------------------------------------------

Edited to add a link to a picture of the roadmap format, with a couple of elements dragged onto it.



Gave up with Dropbox, now using imgbb.com

15
General Board / Re: Inheritance of Tagged Values between Stereotyp
« on: June 24, 2014, 07:25:00 pm »
I suspect that I'm trying to achieve the same as you: because of the sheer quantity of stereotypes, enumerations and metaclasses sitting in an apparently haphazard fashion under the <<profile>>, I decided to have a tidy up, and carefully sorted them out into a number of sub-packages.

The result was much tidier but didn't work, even though I'd realised that I would have to update the pointer within each toolbox to refresh its knowledge of where each stereotype was newly located.

I spent much of last evening trying to fix this, but this morning noticed the following line within the EA Manual:
"A Profile package can contain several diagrams and many elements and connectors, but no other packages; do not use nested packages in a Profile"

This I think explains why my tidy up broke a previously working toolbox, so I've just gone through dumping all the stereotypes into the <<profile>> 'root'.

Maybe I've misunderstood what q. meant, but suggest you try the change on a small subset first...

Pages: [1] 2 3 4