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 ... 3 4 [5] 6 7 ... 571
61
Thanks, for pointing me to these resources.  I also found this library that avoids Interop and writes to the XML files directly, which looks pretty promising as I do pretty much all my scripting from Visual Studio.   https://github.com/ClosedXML/ClosedXML

We did that with a word document generator a few years ago. I remember that avoiding the Office Interop resulted in a much faster generation of documents.
With Excel I haven't needed this yet as the Value2 works almost instantaneous.
Usually it takes a lot longer to get the information out of EA than it takes to get it into Excel.

Geert

62
Rich,

A major improvement is to use range.Value2.

How that works is that you create a 2 dimensional array with your data.
The select the range you need and set Value2 to it.

That works almost instantly, as opposed to adding field by field.

See https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Framework/Utils/ExcelFile.vbs for an utility class to deal with excel files

Geert

63
I know from the test settings from back when I developed the add-in that it needs a "/"

I'm not sure what is going wrong in your context. I would need to be able to debug it to find out.

Geert

What sort of data/information would be needed for debugging?

Robert
Robert, if you send me an email geert@bellekens.com we can try to work something out.

Geert

64
I know from the test settings from back when I developed the add-in that it needs a "/"

I'm not sure what is going wrong in your context. I would need to be able to debug it to find out.

Geert

65
You have to add a "/" to the default collection name

So "MAVICollection/"

That should do it.

Geert

66
Automation Interface, Add-Ins and Tools / Re: Visual Bacis Arrays In EA
« on: October 25, 2018, 10:49:13 pm »
AddNew() is a method from EA.Collection, not from ArrayList.

For ArrayList you just use Add(object)

Geert

67
General Board / Re: Export to CSV in specific order
« on: October 25, 2018, 07:18:27 pm »
I would write an SQL search query (where I control the order) and then export the results to CSV.
No scripting needed.

If however you need notes fields with newlines etc.. you might want to consider scripting somehow.
I have done a few exports like that to Excel directly, including formatting in excel.

Geert


68
SourceColumns and TargetColumns is probably related to FK relations specifically, I'm not sure.

Anyway from the Diagram > Connector> you can't access the Source and Target Sections.
Only from Element > Connector>

Geert

69
Bugs and Issues / Re: Changing Status field with Scripting
« on: October 25, 2018, 01:50:40 am »
if caseArray is an array and not an EA.Element, how can caseArray.Status ever work?

Geert

70
General Board / Re: Connecting 2 elements with dependency connector
« on: October 24, 2018, 06:05:25 pm »
EA.Element.Connectors.AddNew()

Geert

71
You shouldn't use GetByName (ever)

Why don't you simply loop the packages until you have the one you need?

Something like:

Code: [Select]
    dim myP as EA.Package
    dim curP as EA.Package
    set curP = nothing 'initialize

    For Each packageString In packageArray
        For Each curP in rootPackage.Packages
            If curP.Name = packageString then
                 Set myP = curP
                 exit for
            end if
        next
   next

Geert

72
Yes, report as bug to Sparx.

Little obvious bugs like this often get fixed quite quickly.

Geert

73
[SNIP]

The Message Composer copies the stereotypes from the source to the subset model.

Then depending on what you wanted to generate you'll have to
- generate it using your own script/add-in
- transform it to a PSM for the technology you are generating to (XML Schema model in case of XSD target) and then use the standard XSD generation tool.

Geert
Hi again Geert,
I just wanted to clarify your usage above with what I saw on the website for EA Message Composer.

As I understand it, the Message Composer is used to create the subset model and then the Schema Composer is used to generate the payloads.  When you mention "standard XSD generation tool" do you mean marking the [X] XML Schema (XSD) checkbox in the Schema Export dialog of the Schema Composer? If that's not the case, what function does the Schema Composer perform?

Paolo
Hi Paolo,

No we use the Schema Composer only to be able to cherry-pick the message content from the general model.
The EA Message Composer is is a Schema Composer add-in that reads the profile and creates the subset model (fully traceable to the main model)

Some clients use this tool on model with an XML Schema profile applied. They use the the standard XSD generation Ribbon =>  Code | Schema | XSD |  Export and XML Schema (XSD) File to generate the code.

Other clients use this on their logical model and have their own tool (one of them written by me) to generate XSD's from the logical model.

I don't think the Schema Composer as such is very useful for generating XSD's directly as it offers no options at all for style etc.., but the cherry picking part is very good.
The standard XSD generation feature is much better (has a lot more options), but you need to start from a physical XSD model to be able to use that.

Geert

74
I didn't see it at once, but that is indeed one of the classic gotcha's.
Still gets me once in a while, and I write VBscript code at least once a week.

Geert

75
Paolo,

I'm not that versed in Transformation templates, but I do have a lot of experience with the Schema Composer.

The way a lot of my clients use it is to first generate a subset model using my add-in EA Message Composer and then generate whatever they need (usually XSD) from that subset model.

The Message Composer copies the stereotypes from the source to the subset model.

Then depending on what you wanted to generate you'll have to
- generate it using you own script/add-in
- transform it to a PSM for the technology you are generating to (XML Schema model in case of XSD target) and then use the standard XSD generation tool.

Geert

Pages: 1 ... 3 4 [5] 6 7 ... 571