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 - MatthiasVDE

Pages: 1 2 [3] 4
31
Automation Interface, Add-Ins and Tools / Re: C# + Scheduled Task= Error
« on: October 13, 2016, 02:20:44 am »
string conn = @"C:\EA\Shortcut.eap";

But how can you explain that it only fails when the application is executed by the scheduler?

32
Automation Interface, Add-Ins and Tools / C# + Scheduled Task= Error
« on: October 13, 2016, 01:34:15 am »
I wrote a C# application for exporting html reports. When I run the .exe manually it works fine, but when it starts from a scheduled task I get the following error:
The remote procedure call failed. (Exception from HRESULT: 0x800706BE)


EA.Repository repo = new EA.Repository();
repo.OpenFile(conn);  --> The error is on this line.

33
I assume the Update follows since you say the DB is changed. Close/re-open the diagram to make the changes visible.

q.

Did it, but no results.

34
If I run this code, the values are changed in the database, but in Enterprise Architect I don't see anything

Quote
If attrType = "VARCHAR2" Then
        myAttribute.Length = attrLength
        myAttribute.Precision = "0"
    End If
   
    If attrType = "NUMBER" Then
       myAttribute.Precision = attrLength
       myAttribute.Length = "0"
    End If

35
I checked all the fields in the database and this is the result:

Quote
Public Function addOrUpdateAttribute(parentClass As EA.element, name As String, stereotype As String, description As String, attrType As String, attrLength As String, default As String, allowduplicates As Boolean, isordered As Boolean) As EA.Attribute
    Dim myAttribute As EA.Attribute
    'try to find existing attribute with the given name
    Set myAttribute = getAttributeByName(parentClass, name)
    If myAttribute Is Nothing Then
        'no existing attribute, create new
        Set myAttribute = parentClass.attributes.AddNew(name, "Attribute")
    End If
    'set properties
    myAttribute.stereotype = stereotype
    myAttribute.Notes = description
    myAttribute.Type = attrType
    myAttribute.StyleEx = "volatile=0;"
   
    'varchar -> length, number -> precision
    If attrType = "VARCHAR2" Then
        myAttribute.Length = attrLength
        myAttribute.Precision = "0"
    End If
   
    If attrType = "NUMBER" Then
       myAttribute.Precision = attrLength
       myAttribute.Length = "0"
    End If
   
    'set initial value (default)
    myAttribute.default = default
   
    'set not null (allowduplicates)
    myAttribute.allowduplicates = notnull
   
    'set PK (isordered)
    myAttribute.isordered = pk
   
    'save attribute
    myAttribute.Update
    'refresh attributes collection
    parentClass.attributes.Refresh
    'return attribute
    Set addOrUpdateAttribute = myAttribute
End Function

But it doesn't work, the script only creates the table with attributes of a specific type.
No length, pk, not null, ....

I tested it over and over again...

36
It works, but there's stil a problem.

I use the importer to add attributes to columns, but I can't add or update the following fields:
- Length
- PK
- Not Null
- Scale
- Initial Value



37
Can I do it with this function?

Code: [Select]
Public Function addOrUpdateAttribute(parentClass As EA.element, name As String, stereotype As String, description As String, attrType As String) As EA.Attribute
    Dim myAttribute As EA.Attribute
    'try to find existing attribute with the given name
    Set myAttribute = getAttributeByName(parentClass, name)
    If myAttribute Is Nothing Then
        'no existing attribute, create new
        Set myAttribute = parentClass.attributes.AddNew(name, "Attribute")
    End If
    'set properties
    myAttribute.stereotype = stereotype
    myAttribute.Notes = description
    myAttribute.Type = attrType
    'save attribute
    myAttribute.Update
    'refresh attributes collection
    parentClass.attributes.Refresh
    'return attribute
    Set addOrUpdateAttribute = myAttribute
End Function

38
I have a data modeling diagram with several tables and much much much attributes.
All the attributes (names, types, lenght, ...) are available in  a csv file.

Can I import them to a specific table directly from the csv file?

39
General Board / Wireframe image - change size
« on: July 11, 2016, 07:30:33 pm »
For the creation of a wireframe I use the wireframe image UI control, and choose and alternate image.
But I can't find a way to change the size of the image, I can drag the image to another size, but is it possible to enter the width and height?

40
I thought that it generated everything if you passed in an empty guid.

It doesn't work...

Code: [Select]
repo.GetProjectInterface().RunHTMLReport("", modelPath, imageFormat, style, ext);

41
General Board / Display elements automaticaly in a grouping box
« on: June 28, 2016, 06:25:03 pm »
My project consists of different packages per domain, each with Archimate diagrams and application components.
In the 'parent' package I created also an Archimate diagram, but with grouping boxes. These grouping boxes represent the different packages per domain, so I would like to see the created application components in the domains, automatically represented in the grouping boxes.

Can I create instances from the packages to make this happen, or what is the proposed solution in this case?

42
General Board / Re: Remove instance classifier
« on: June 22, 2016, 04:43:40 pm »
It works, thanks Geert  :)

43
General Board / Remove instance classifier
« on: June 21, 2016, 10:03:30 pm »
Is it possible to remove an instance classifier, for example from a Pool or Lane?

44
Just a bump, is it possible to combine all the models in one report so that I have the same as my project browser in the sql repository? Now the code creates and overwrites the html report for each model.

45
It works!

Code: [Select]
foreach (EA.Package package in repo.Models)
             {
             
              modelName = package.Name;
              GUID = package.PackageGUID;
              Console.WriteLine(modelName + " - " + GUID);
              modelPath = exportPath + modelName;
              System.IO.Directory.CreateDirectory(modelPath);
            repo.GetProjectInterface().RunHTMLReport(GUID, modelPath, imageFormat, style, ext);
             }

I have to create another subfolder for each report because otherwise he overwrites it. Is it possible to combine all the models in one report so that I have the same as my project browser in the sql repository?

Pages: 1 2 [3] 4