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 - Ian Mitchell

Pages: [1] 2 3 ... 22
1
Thanks Geert - this works perfectly, of course.
The only bit I don't understand is the last line:
Code: [Select]
and ( o2.Package_ID is null or o2.Package_ID <> o.Package_ID)Without this, I get lots more duplicate data, but I don't really understand why. Other than the nice one was done by you, and other by me...

Also, I was very brave, and did another join from  'o2' to any t_xref entries (to get additional stereotype information).
Something like
Code: [Select]
select * from
 ((
(t_object o left join t_connector c on (o.Object_ID = c.Start_Object_ID  or o.Object_ID = c.End_Object_ID)  )    left join t_object o2 on (o2.Object_ID = c.Start_Object_ID   or o2.Object_ID = c.End_Object_ID))
left join t_xref x on (o2.Ea_guid= x.Client)
)
where o.package_ID IN (1235,1236)
and ( o2.Package_ID is null or o2.Package_ID <> o.Package_ID)

I think I may have discovered
Code: [Select]
Geerts Secret of SQL - add lots of brackets, everywhere, until it works. Then stop.


2
Thanks Phil, but this one doesn't seem to return elements which don't have connectors, and I need them as well.
I guess I could just run a second query without the clever 'join' bits..
Cheers

3
I need to create a performance enhancement bit of SQL, but I think I just went beyond my abilities.
The problem is to get
(1) all the elements in a package and
(2) where they have connections to other element, details of the other element as well.
I managed to get 1/2 way with:
Code: [Select]
SELECT  *
FROM (T_OBJECT LEFT OUTER JOIN T_CONNECTOR ON T_OBJECT.OBJECT_ID = T_CONNECTOR.START_OBJECT_ID)
WHERE T_OBJECT.package_ID=1235

(no, I won't be using Select *...)
This is great - it returns all the elements, and details of their connectors. OK, there are some duplicate rows where an element has multiple connectors, but I'm fine with that.
What I can't seem to get to work it to re-join this back to t_object, to get all the details of each related object.
I've tried all kinds of variations with more joins, lots of brackets/no brackets, but I now feel like a monkey writing random SQL and hoping for an answer...

4
Thanks Q and Eve.
For completeness, the solution is to un-check the 'Strict connector syntax' on Start / Preferences / Preferences / Links /General.
Every day's a school day...

5
...but I don't want to link the note to a connector - just an element.
So where do I tell EA to 'just do what I tell you.."

6
I'm annotating a UI model (using the Win32 User Interface style) and I want to add a note to a GUI Element.
And EA says "The requested connection is not UML compliant"  - but this is just a note, and I thought notes could attach to anything? I'm amazed the UML has anything to say about this.
Is this right? I'm not allowed to connect a note to ANY GUI element?
It also doesn't work when choosing the 'Note link' option from the 'Common Relationships' toolbox: in this case, it just doesn't create the link - no error.
Did I just pick a bad type of model to use this on? It also doesn't seem to like notes on Wireframe style diagrams.
I'm (fairly) sure that we used to be able to attach notes to anything? At least, that's what I've been teaching for the last 10 years...
 
Also, when I try to connect a note to a different kind of element (say, a Requirement) then I get TWO 'link' options in the Quick Linker popup - this is just a bug, but at least it works.


This is EA 15.1, with all addins switched off.

7
General Board / Re: Dynamic Documents to document diagrams
« on: February 19, 2020, 08:25:34 pm »
(declared interest - I am the author of the tool mentioned below)
I'm not sure if it's exactly what you want, but eaDocX can create a document from a single diagram.
Just right-click on the document, and choose eaDocX / Quick document.
It will use your current Word default template, and include the diagram image, and all the elements which are contained in the diagram. It uses some default formatting, to make sure everything appears, but you can then add/remove content and change formatting, as you require.

8
(declared interest - I'm the author of the tool mentioned below)
eaDocX can do this, and at the same time add additional header rows and columns, and add conditional formatting. The example we use is a RACI matrix, where eaDocX maps the string 'Responsible' to a simple 'R', and adds appropriate color. So the model stays the same. It can also print a matrix in a more linear format (see the eaDocX help for an example) where the matrix has too much data to appear in a readable page.

9
General Board / Set default data type to <none>
« on: February 19, 2020, 08:17:35 pm »
This has been bugging me since about V4: when I'm doing conceptual modelling, using UML class diagrams, I want to create attributes of classes, but I'm not ready to commit to them having a specific data type. I'll do that later, if at all.

So, if I'm modelling like this, I'd like to say "always create new class attributes with a data type of <none>". The default is 'Int'.
Is there a setting somewhere to do this?
Not a big deal, but it would smooth over a small rough edge...

10
Automation Interface, Add-Ins and Tools / Re: Joining mis-matched columns
« on: February 18, 2020, 04:22:17 am »
 :(

11
Automation Interface, Add-Ins and Tools / Re: Joining mis-matched columns
« on: February 10, 2020, 11:03:20 pm »
Strange that the act of putting something onto this forum magically helps me find an answer myself.
Seems that coercing strings into numbers isn't allowed ( sensible, I suppose, even though I know it will work in my case, but maybe Access is protecting me from myself..)
..but coercing numbers into strings is allowed.

Key bit of SQL seems to be:
T_OBJECT.PDATA1 = CStr(T_DIAGRAM.DIAGRAM_ID)
So, I make both sides into strings, and join on them.

So the full SQL to get the Activity-type composite diagrams (see 'Inside EA for more explanation) is:
Dim s As String = " Select T_DIAGRAM.PACKAGE_ID,T_OBJECT.OBJECT_ID as OBJECT_ID,  t_OBJECT.PDATA1 as DIAGRAM_ID, T_DIAGRAM.DIAGRAM_TYPE , T_DIAGRAM.STYLEEX  "
        s = s & " FROM T_OBJECT, T_DIAGRAM  "
        s = s & " WHERE "
        s = s & " T_OBJECT.NTYPE=8 "  'This is what tells us that PDATA1 is the ID of the Composite diagram
        s = s & " AND "
        s = s & " T_DIAGRAM.PACKAGE_ID in " & instring
        s = s & " AND "
        s = s & " T_OBJECT.PDATA1 = CStr(T_DIAGRAM.DIAGRAM_ID) "

...where instring is a string of numbers of the packages we want to search into.

12
There's a beer at the next EA User Group for anyone who comes with this. It would be REALLY useful...

13
Automation Interface, Add-Ins and Tools / Joining mis-matched columns
« on: February 10, 2020, 10:25:37 pm »
I need to do a join on t_object.pdata1 and t_diagram.diagram_ID - as a way to find out which diagrams are Composites (Thanks QUERTY for the hints in 'Inside EA' - how would we manage without this?).
BUT
The data types of the columns are different - PDATA1 is a varchar, Diagram_ID is a number.
Stackoverflow etc seem to suggest that it's possible to do a join (in Access - this is an EAPX file at the moment, but will need to work in other DBMSs as well later) where the column data types are different, by 'casting' in the SQL, but I can't seem to get this to work.
Does anyone have experience of doing this kind of cast/join ?

14
@Geert - you, as always, entirely correct:
From Sparx Support:
The issue has been confirmed and will be investigated further by our development team. The reference number for this issue is 20013927. This will be fixed in a future build.

I agree with the general sentiment about cynicism, and avoiding it where possible. We should remember that, compared to absolutely every software product I have used in the last 40 years, EA is by far the most reliable. Those using other modelling tools are in awe of EA's stability under pressure.

Sadly, the fixing of this particular issue doesn't help me at all, as most users will have EA versions which have the error, so my code still needs to handle the duplicate events. But it's one more improvement in product quality.
 

15
OK - I''l try...

Pages: [1] 2 3 ... 22