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.


Topics - Ian Mitchell

Pages: [1] 2 3 ... 5
1
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...

2
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.

3
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...

4
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 ?

5
Just installed V15.1, and about the first thing I did was to set my current diagram as the Model Default.
Or rather, I didn't.

V15 help says (in https://sparxsystems.com/enterprise_architect_user_guide/15.0/user_interface/using_the_diagram_panel.html) that the options include 'Set as user Default', and 'Set as Model Default'.

V15.1 help says (in https://sparxsystems.com/enterprise_architect_user_guide/15.1/user_interface/using_the_diagram_panel.html) that these options are no longer there. So the code is 100% consistent with the documentation!

Ok, so (1) why are they no longer there? and  (2) where are they now?

Oh, and (3) how many other secret changes to the UI have been made, that I'll only find when I'm in the middle of a customer demo, which will make me look an idiot. Again.
And please can the wonderful person who did a 'DIFF' on the documentation between two previous versions please do it again for v15 to v15.1.

 >:( >:( >:( >:( >:( >:( >:(


6
My addin is looking at elements being added to a diagram, and responding to the broadcast events, but I seem to be getting a duplicate event.

(these test cases were done is a simple 'hello world' addin, with no additional function)

In the simple scenario, all is well:
Drop an element into a diagram, and the events are: (all return 'true' to EA)
  • EA_OnPreNewElement (just provides the type of element being added, and the diagram ID.) The real addin does some checking here, and returns TRUE when it's OK. In this test, always responds TRUE
  • EA_OnPostNewElement - now we have the actual element ID
  • EA_OnPreNewDiagramObject - ElementID and diagram ID provided
  • EA_OnPostNewDiagramObject- Element ID and diagram ID again
Prefect, and exactly as I expected.

Now change the 'pre diagram object' event to reject this element, so it returns 'false', and we get:
  • EA_OnPreNewElement (just provides the type of element being added, and the diagram ID
  • EA_OnPostNewElement - now we have the actual element ID
  • EA_OnPreNewDiagramObject - ElementID and diagram ID provided - Return FALSE to reject the element
But wait - there's more!
I now get ANOTHER 'EA_OnPreNewElement' event, with the same parameters as before: type & stereotype of the element, and the diagramID.

This is (1) unexpected and (2) a problem.
When the extra event is received, the same code runs as on steps(1) above, and it returns TRUE, which causes an EA error:
'Unknown/illegal base type (UseCase)
Command: UML::UseCase'

(UseCase is just the type i'm using to test this)

..and I can't suppress this message.

I've been trying all day to work out (1) why I get a duplicate event and (2) how to detect that I'm getting a duplicate event, and respond with 'false' the second time around.
So far all solutions are horrible, and are not reliable anyway.

Can anyone suggest why I'm getting the second 'On_Pre_Element' event? Is this a bug? Or a feature ?
Thanks
Ian

7
I have an addin which is used by both a model manager - for doing important changes to some model rules - and by regular modellers.
For performance reasons, whist the modellers are working they use a cached version of the rules (there are lots) but I need a way for the model manager to force every active instance of the addin to refresh it's copy of the rules. (when a modeller restarts EA it will refresh anyway - but this is for those bad people like me who have EA open 24/7)
A perfect solution would be for model manager's instance of the Addin to create an event, which is then picked-up by all the other instances, but there doesn't look to be such a thing.
Another solution would be to have a place in the model where the manager instance can write data, which could then be constantly examined by the modeller instances for any changes, but that would be building a performance bottleneck. And rubbish.
Has anyone solved this ?
Thanks

8
Automation Interface, Add-Ins and Tools / When is an element 'embedded' ?
« on: October 15, 2019, 12:30:19 am »
Does anyone know of a way to find out if a particular element is 'embedded' ?
The error message which comes up when I try to drop such an element into a diagram says "When dropping embedded elements (Ports, Object nodes etc.)..." which suggests that all elements of type 'Port' and  'Object Node' are automatically 'embedded' - it's just the 'etc' at the end of the message which worries me - are there more?
And are they a fixed set?
The EA15 help has some more examples of embedded element types: Parts, Pins and Parameter Sets (at https://www.sparxsystems.com/enterprise_architect_user_guide/15.0/automation/element2.html)


9
General Board / V15 (beta 4) - Feature Linker
« on: June 19, 2019, 02:44:02 am »
A big round of applause for the V15 "Feature Linker" feature. Now we can quickly link attributes/ops of a class to other attributes/ops in another class, without the 17-step process we used to follow.
This should enable EA to be WAY better at, say, documenting ETL (extract, transform, load) processing for data warehouse applications, where we need to understand which attributes in the source map to which ones in the target, via which operations. There is even a feature in eaDocX/Excel to do this, which i guess now looks less important, unless you have loads of these to input.
AND
The Quick Linker arrow got bigger, I think, which is good for us old folks who don't see so well.

10
The documentation for this method mentions 'pre-Version 7' technologies, which makes me wonder if this is still a method we should be using?
It does exactly what I want - allowing me to make changes to an MDG, and load them without having to get the user to use the UI. (I know there is a startup event to load MDGs, but that's not what I need - must be done in the background whilst the model is loaded)
So far, I have made it import the Profile for elements/stereotypes just fine, but I can't get it to load Diagrams or Toolboxes.
Has anyone else made this bit work, before I spend more time on it....

11
Does anyone have a code fragment - ideally in VB, but C# is fine - to take a string and make it into the base64 encoded, zipped thing which EA expects (in all kinds of places).
By trial & error I figured out how to decode it (see below) without using an intermediate file, using the iconic.zip function, but now I want to put stuff back into EA, and going backwards is always harder...

 
'Specialist function, where we know the content is some XML...
'To return the raw string, just miss-off the last line where xElement is created
Friend Function getXMLFromEABase64(s As String) As XElement
        'initial content is a long gobbledegook string
        Dim content As String = ""
       
            'comments here are assumptions, based on what I see
            Dim d1() As Byte = System.Convert.FromBase64String(s)
            'd1 is now an array of bytes.

            'make the byte array into a memoryStream.
            'Doing this to avoid creating a file anywhere - do all in memory
            Using ms As New System.IO.MemoryStream(d1)
                'make the memory stream into a zip
                Using zip As ZipFile = ZipFile.Read(ms)
                    Dim e As ZipEntry
                    For Each e In zip
                        'no idea what this is doing...
                        Dim ms2 As New MemoryStream
                        e.Extract(ms2)
                        content = System.Text.Encoding.ASCII.GetChars(ms2.GetBuffer)
'not sure why this is needed, but without it, it doesn't work....
                        content = content.Replace(Chr(0), "")
                        Return XElement.Parse(content)
                        Exit Function
                    Next


                End Using
            End Using
   

        Return Nothing

    End Function

12
Will the kind person who did the 'Where have all the menus gone to' guide for V13 to V14 please do it again for V14 to V15?
I get the @Sparx need to make usability improvements, but moving the menu options around every release is getting a bit tiring.
It's a real dis-incentive for customers to upgrade, because of the loss of productivity.

13
General Board / V15 Beta - add new stereotype
« on: May 16, 2019, 06:34:48 pm »
Has anyone else noticed in V15 beta that the default behavior is now that I can't manually type a stereotype for an element or connector?
(This is in a test model, so no security options to forbid creation of new stereotypes - just a plain, new model.)
Now I agree that creating random new stereotypes should generally be discouraged, but the out-of-the-box experience of V15 beta is different from V14.1.
Is this deliberate @Sparx ?

14
I have a repository which won't export packages to XMI, and I get this very 'final' looking error: "Encountered an improper argument". Strange, but I wasn't arguing with EA at the time....
(EA 14.1, EAPX repository, Win10, exporting to local drive, done project integrity check).
Tried on a brand-new rep, and all is fine. Packages when copied from old rep to a new one will then export OK

Strange, but packages will happily create a baselines, which I thought uses the same 'create XMI' code.
Even stranger still, and this is a first for me since about v4, EA hangs.
No way out, just have to kill the process!
I tried checking the 'write log file' option, but I can't remember where this gets written to. Anyone remember ?

Anyone seen this before?

15
General Board / IDs and GUIDs
« on: March 28, 2019, 08:28:58 pm »
After 10 years of making addins for EA, and crawling into the tiny, secret places of the EA database, I have one nagging question.

Is there some deep logic to the use of ObjectID (long numbers, not globally unique) vs. GUIDs (globally unique strings) ?

I realise there may some blindingly simple explanation for this, which I just haven't spotted, but purely out of curiosity, does anyone see a pattern?
@querty - see if you can answer by saying something nice about EA. You know you can do it :)


Pages: [1] 2 3 ... 5