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 - Geert Bellekens

Pages: [1] 2 3 ... 512
1
General Board / Re: Defined variables / string interpolation
« on: November 18, 2017, 12:38:39 am »
I think I would try go about it the other way around.

Make a global glossary of terms and have everyone agree on that.
Then also add all synonyms to the glossary (and mark them as being a synonym using the type)

Then together with the documentation provide the glossary with all "official" terms and all synonyms.

That avoids a ending up in a Babylonian story.

Geert

2
Bugs and Issues / Re: attribute order messed up
« on: November 17, 2017, 03:23:50 pm »
I thought you had to do a collection refresh after the deletion so that the collection could be recalculated.

Paolo
Paolo,

I'm talking about regular access via the GUI, no automation.

Geert

3
To get some inspiration you can check out my VBscript library:
https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library

In case coding yourself is too much of a hassle you can always hire me or another EA consultant ;)

Geert

4
General Board / Re: Can you use multiple values in <Search Term>
« on: November 16, 2017, 10:58:03 pm »
with Search Term:
"rte","bsw"

Should be 'rte','bsw' with single quotes instead of double quotes to be correct SQL syntax.
Some databases don't care, but others will.

Geert

5
If you know exactly the number of hops between your source and target then you could easily do this as an SQL query, which is of course the preferred solution for tabular output.

If you don't then a script solution is required (which will be a LOT slower)

I haven't done anything specific like that, but you would basically have to keep iterating the Element.Connectors in a recursive called function and test the target element for type or stereotype or whatever you make the criteria for your target.
Just make sure you keep a list of visited elements in order to avoid endless loops.

Geert


6
Bugs and Issues / attribute order messed up
« on: November 16, 2017, 07:12:04 pm »
When deleting attributes the positions of the attributes are not recalculated. This results in inconsistent behavior when adding attributes and changing their order.

This is a serious problem for anyone doing any type of code generation (xml, DDL)

Current workaround is to move the new attribute all the way to the first position and then back. This triggers a recalculation of the position for all attributes.


Steps to Reproduce:
- turn off alphabetic ordering for attributes
- Create class with following attributes
Pos name
----------- ----
0 z
1 q
2 n
3 h
4 a

- Delete "n" and "h" I'm and notice the missing pos 2 and 3

Pos name
----------- ----
0 z
1 q
4 a

- Add "m" to the end and save
- Notice that m has gotten pos 3 and is therefore placed between q and m instead of at the end.

Pos name
----------- ----
0 z
1 q
4 a
3 m

7
Yes, but it's inconvenient (due to inconsistency). You need to look after the "stereotype" of a diagram in StyleEx in the MDGDgm tag.

q.

No argue with that.

Geert

8
Can't you do all of that without the stereotype as well?

Geert

9
To be able to completely run this script you need the supporting framework scripts

See this for more info: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Framework/Wrappers/Include.vbs

Some more info on how to load all the scripts here: https://bellekens.com/2015/12/27/how-to-use-the-enterprise-architect-vbscript-library/

Geert

10
The question is whether it is EA or Excel who converts the date.

I would suspect Excel rather then EA.

Things I would try:
- re-format dates in the format "yyyy-mm-dd" This could never lead to wrong interpretations.
- read the CSV file directly instead of going through Excel.

example below:
Code: [Select]
'[path=\Projects\Project AC]
'[group=Acerta Scripts]

!INC Local Scripts.EAConstants-VBScript
!INC Wrappers.Include

'
' Script Name: Import Identifiers
' Author: Geert Bellekens
' Purpose: Import the identifiers exported from MEGA's Candidate key members
' Date: 2016-07-14
'

const outPutName = "Import Identifiers"


sub main
dim mappingFile
set mappingFile = New TextFile
'select source logical
dim logicalPackage as EA.Package
msgbox "select the logical package root (S-OAA-...)"
set logicalPackage = selectPackage()
'first select the mapping file
if mappingFile.UserSelect("","CSV Files (*.csv)|*.csv") _
   AND not logicalPackage is nothing then
   'create output tab
Repository.CreateOutputTab outPutName
Repository.ClearOutput outPutName
Repository.EnsureOutputVisible outPutName
'set timestamp
Repository.WriteOutput outPutName, "Starting import identifiers " & now(), 0
'split into lines
dim lines
lines = Split(mappingFile.Contents, vbCrLf)
dim line
for each line in lines
'replace any "." with "::"
line = Replace(line,".","::")
'split into logical and physical part
dim parts
parts = Split(line,";")
'there should be 4 parts in the csv file: Identifier - Attribute or Role Name - AttributePath - RoleName + [ID]
'we should have enough info from the name, and the fact that we know whether it is an attribut or a RoleName
if Ubound(parts) = 3 then
dim IdentifierFQN, idName, isAttribute
IdentifierFQN = parts(0)
'check if the IdentifierFQN is not empty and is a valid FQN
if len(IdentifierFQN) > 0 AND instrRev(IdentifierFQN,"::") > 1 then
idName = parts(1)
if len(parts(2)) > 0 then
isAttribute = true
else
isAttribute = false
end if
dim classFQN
'remove the last part of of the IdentifierFQN in order to get the class name
classFQN = mid(IdentifierFQN , 1 , instrRev(IdentifierFQN,"::") - 1)
if isAttribute then
'set identifier on attribute
setIdentifierAttribute logicalPackage,classFQN,idName
else
'set identifier on association end
setIdenfifierAssociation logicalPackage,classFQN,idName
end if
end if
end if
next
'set timestamp
Repository.WriteOutput outPutName, "End import identifiers " & now(), 0
end if
end sub

function setIdentifierAttribute(logicalPackage,classFQN,idName)
dim attribute as EA.Attribute
set attribute = selectObjectFromQualifiedName(logicalPackage,nothing, classFQN & "::" & idName , "::")
if not attribute is nothing then
'set isID property on attribute
'log progress
Repository.WriteOutput outPutName, "setting {id} on attribute " & classFQN & "." & attribute.Name,0
attribute.IsID = true
attribute.Update
else
'log the fact that we didn't find it
Repository.WriteOutput outPutName, "ERROR: could not find attribute for " & classFQN & "." & idName,0
end if

end function

function setIdenfifierAssociation(logicalPackage,classFQN,idName)
dim classElement as EA.Element
set classElement = selectObjectFromQualifiedName(logicalPackage,nothing, classFQN, "::")
if not classElement is nothing then
'find the associationEnd
dim association as EA.Connector
'register the fact that we found it or not
dim foundIt
foundIt = false
for each association in classElement.Connectors
if association.Type = "Association" or association.Type = "Aggregation" then
dim associationEnd as EA.ConnectorEnd
set associationEnd = nothing 'initialize to be sure
if association.ClientID = classElement.ElementID then
set associationEnd = association.SupplierEnd
else
set associationEnd = association.ClientEnd
end if
if not associationEnd is nothing then

if associationEnd.Role = idName _
AND left(associationEnd.Cardinality,1) = "1" then 'only for obligatory associations
if not foundIt then
'log progress
Repository.WriteOutput outPutName, "setting {id} on association " & classFQN & "." & idName,0
'found the correct one
associationEnd.Constraint = "id"
associationEnd.Update
'register that we found one
foundIt = true
else
Repository.WriteOutput outPutName, "ERROR: found duplicate rolename for " & classFQN & "." & idName,0
end if
end if
end if
end if
next
if not foundIt then
'log the fact that we didn't find it
Repository.WriteOutput outPutName, "ERROR: could not find association role for " & classFQN & "." & idName,0
end if
end if
end function

main
This script and helper supporting scripts can be found at https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library

Geert

11
General Board / Re: How to Change EA login ID
« on: November 14, 2017, 01:22:25 am »
Taylor,

Check the Project Authors.

See http://sparxsystems.com/enterprise_architect_user_guide/13.5/user_interface/generalsettings.html
for more explanation depending on the situation.

Geert

12
Ah, thanks that makes more sense.

No I don't think you can, but diagram stereotypes aren't really valid UML constructs you know.

Why is it so important that you have a stereotype on your diagrams? I've done a number of MDG with diagram types, and I never really felt the need for stereotypes.

What would be nice is if we could specify our own icon for a diagram. That would visually set them apart from the other diagrams.

Geert

13
General Board / Re: TFS 2015 SQL 2014
« on: November 10, 2017, 11:24:08 pm »
Hi Matt,

Welcome to the forum.

You should know that Sparx Systems has made this forum available for the users, and although we get regular posts from Sparx Systems employees, this is by no means an official Sparx System channel.
So if you want to consult the community then this is the place to be.
If you need a response from Sparx Systems then you better reach out to support at support@sparxsystem.com
And if they tell you something that you think might be interesting for the whole community, don't hesitate to post the information here.

Geert

14
IIRC we found we had to place them in the General stereotypes list with a base class of Diagram to get them to show up.

But that will not associate the MDG's diagram type with the general stereotype - correct?

Is there any way to add a stereotype (possibly as a default value) from within the MDG, to elements created from the MDG's diagram type?
I'm sorry I don't understand what you mean with "elements created from the MDG's diagram type"

Geert

15
Yes, that is possible.
Join t_attribute tags multiple times, each time with a constraint on the tag name.
Something similar to this:

Code: [Select]
left outer join [t_attributetag] v on (v.[ElementID] = att.[ID]
                                and v.[Property] = 'Versioned'))
left outer join [t_attributetag] ts on (ts.[ElementID] = att.[ID]
                                and ts.[Property] = 'Timesliced'))
left outer join [t_attributetag] dc on (dc.[ElementID] = att.[ID]
                                and dc.[Property] = 'Data Classification'))

This gets the data for tagged values with name Versioned, Timesliced and Data Classification.
Use dc.Value as DataClassification in order to use the field in your result set.

Geert

Pages: [1] 2 3 ... 512