Messages - stevesavage

I've started making heavy use of the new Image Asset element to bring in mock-ups created by our development team so I can link them to BPMN activities.E.g. while doing the activity the actor is interacting with the IT solution using the interface.

Because they are NOT using Sparx EA for the mockups (using Balsamiq), I'd like to:

Export screens from Balsamiq

Import them in to Sparx EA (and store in Sparx EA) using the file names as the Element Name

If they later update

Export screens from Balsamiq

Run a script in EA that replaces the images in Sparx with the new images, using the file/element names for matching

Does the API have a feature for this, or one planned for this?I was hoping for something similar to the Element.LoadLinkedDocument(string Filename) function.E.g. LoadLinkedImage(string Filename)

Thanks Paolo, I thought that might be the case, but at the moment I haven't found a GUID that it matches up with.

The image asset is stored in t_document,

docID = {5E923B0A-B2C7-4761-9739-480DA752DCAE}

Style = {19435D98-9499-4cbb-96B7-C58D39CB8DF7}

ElementID = {5E923B0A-B2C7-4761-9739-480DA752DCAE}

In t_object,

the image asset Element GUID = {5E923B0A-B2C7-4761-9739-480DA752DCAE}

the Class Element with the updated appearance has the GUID {34B7553B-BF89-48a1-936B-0C635E78DB37}

There is also an XREF entry for the image asset:In t_xref, the XrefID = {A21E578D-6DCE-41a7-8986-B42E417636DB}, client = {5E923B0A-B2C7-4761-9739-480DA752DCAE} (the client is the GUID of the asset Element)

The GUID of the diagram = {DE664BE3-F69F-4259-A0B2-7F8FFDCEB351}

So I'm not sure where 608EC5C1 was pulled from.

I put the same Class Element on a different diagram and set it appearance to the same image asset and go a DUID of FFEED9EF

Hi Guillaume, I've also been experimenting with image assets, this is what I've found so far:

You can use the image assets directly in diagrams, they seem to be treated as class elements.... I've been in contact with Sparx, and they don't recommend using image assets directly in you diagram, the intent is to use them as an alternate image

You can use image assets as the "alternate" image for an element, but you have to set this for each diagram the element appears in... a bit of a pain

Once you set the image asset as the alternate image, you can update the image linked to the image asset and all you diagrams and elements pointing to it are updated.

What I'd like is a way to set the image asset as the "default" appearance for the element, but that doesn't seem to be possible yet.

So I'm trying to see if I can make a script work around for step 2. At the moment this is what I've figured out:

Each image file is stored in the table t_documents that references the GUID of the image asset Element

Each image asset element is stored in the t_objects table (like all other elements), element's GUID = {5E923B0A-B2C7-4761-9739-480DA752DCAE}

When you want to use the image asset for an element in the diagram:

You select an element, then select "appearance->select image asset as alternate image

Sparx EA updates t_diagramobjects and the ObjectStyle field for the diagramobject representing the element: DUID=608EC5C1;

Sparx EA then updates t_diagram and the StyleEx field for the diagram: OPTIONS_608EC5C1=AIG={5E923B0A-B2C7-4761-9739-480DA752DCAE}:;

So it seems to be that a script could be created that would work by:

Select an Element in a diagram that has already had it's appearance linked to the image asset

The Script identifies all diagrams that contain the Element

The Script would update the diagramobject.style in each diagramobject for the Element

The Script would update the diagram.styleEx for each diagram contain an diagramobject for the Element

Will experiment and post once I figure things out.What I don't know right now is how Sparx EA generates the value DUID=608EC5C1;

Hi Query, I've discovered that calling Session.Prompt actually pauses script execution.I already have a similar script working where I select Diagram Objects

I use that script to select a set of Diagram Objects, then select Elements in the Project Browser, and then the script creates a trace relationships between the Diagram Objects and the Selected Elements. The script creates the a trace relationship in the correct direction based on Element Types + Stereotypes.

I find this quicker than dragging to the diagram, or using a matrix in many cases.

I'd like to do the same between the Package Browser and the Package List View.

Hi Roy, I don't think we're talking about the same thing.The user guide mentions linking to an asset in my notes, or a linked document.

I want to know how to reference an asset's image directly in an RTF reporting template so that when the report is looping through the image assets in a package, the images will be displayed in the report.

"We had a similar report and found that the issue was caused by a stereotype which had been defined in the project "UML Types". Please try the following...Open the project which is having the issue, then open the UML Types dialog (via "Configure > Reference Data > UML Types"). In the list of stereotypes, locate the "EAUML::trace" stereotype (see attached) and delete it. Trace connectors should be created correctly (if not, please let us know)."

For trace relationships that you've already created, that have the wrong stereotype, I wrote a quick jScript script to fix them.

I was really hoping to make use of the new Dynamic Documents feature to improve the readability of information contained in my model.Unfortunately every time I try using one, EA stops responding, I'm using EA 13.09.

Just wondering if this is isolated to me, or if others are having the same issue.I'm sure this was working on an earlier version of 13, but I don't really want to role back.Tested on both our Oracle repository, and a local MS-Access EAP file, using a "reqirement" element with no stereotype.

When I generate a report (docx), the bookmark for an Element section is being placed at the "end" of the Element instead of the beginning.Running the same report with the same template on Sparx EA 12.1.1224 correctly places the bookmark at the beginning of the Element section.

Started experimenting with the new Image Asset, really liked what I saw at first, and could see me using this for linking screen mockups to activities.

Using Sparx EA 13.08 on Windows 7.

Create an image asset by:1. Dragging a .png file on to a diagram2. Select "as image asset"3. Select the new image asset on the diagram, right click and check "Show Owned Image"4. Diagram now shows the "image", perfect for what I need.5. Select the new image asset on the diagram, right click and check "Update Stored Image"6. Select a different PNG file7. Select the new image asset on the diagram, "Show Owned Image" is now unchecked8. Tried checking "Show Owned Image", stays unchecked

Variation: 1. Dragging a .png file on to a diagram2. Select "as image asset"5. Select the new image asset on the diagram, right click and check "Update Stored Image"6. Select a different PNG file7. Select the new image asset on the diagram, right click and check "Show Owned Image"8. No change, "Show Owned Image" is still unchecked

I know this has been around since 12.1, but I'm finally getting around to experimenting with this now, and it's showing a lot of promise of making more complex documents.Has anyone else been experimenting with this?

Under Document Options -> Custom Query you can select Document Script, then select the script from your script library with the function you want to call (or select a script in the language you want to use, then write the function in the provided area)

I'm currently working on a mapping tool that will probably make this easier for you.The project is at the stage that I have now a list of sponsors and I'm getting them to agree on a list of requirements. I'm hoping to have a first version ready before the end of the year.For more information see http://bellekens.com/2016/09/22/ea-mapping-tool-the-next-steps/

Another tool I mentioned is the EA Message composer which will allow you to create a subset of a model, selecting classes, attributes and associations you are interested in. The subset model keep complete traceability to the original model. That might be useful in your situation as well.

Geert

Thanks Geert, will take a look. For now I created a script that links the Business Activity to all the Attributes in the Class, I think just delete the ones I don't want. E.g. Select Activity, run script, prompted to select one or more classes, prompted to enter the type and stereo type of the connector you want, then script links all the attributes. I then delete the ones I don't want. Not the best, but still manually faster than creating them one at a time.