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

Pages: [1] 2 3 ... 10
1
Bugs and Issues / Re: HTML export urls get mangled by Word
« on: November 05, 2019, 04:04:12 am »
It looks like Word is translating the '{' & '}' literally.  You might try substituting { for '{' and } for '}' which are the html escape representations for those two.  I pulled the escape characters from https://www.werockyourweb.com/html-escape-characters/ .

I haven't tried this but have had similar issues sometimes in the past.

Stan.

2
Sure, drop the component on a diagram, right click and choose Insert Related Elements.  You can set various options for type of connection, depth etc.

Stan.

3
The below will also get the process id's directly from the windows running object table. When an EA instance starts up it registers itself with the process id as part of the name.

This is a slight modification of the code I posted here https://github.com/smend5464/SparxEA for accessing a specific instance of EA when multiple are running.

However, if I understand what you are trying to do correctly you only want the list of instances that you start via the interop dll.  I don't think that is possible as that dll is only a .net wrapper around the Com interfaces and references to it would be removed during the build process.  I posted the link above because there might be something you can do by looking inside the running EA instance that might help with identification.

Code: [Select]
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;

namespace SparxProcID
{
    internal class Program
    {
        [DllImport("ole32.dll")]
        private static extern int CreateBindCtx(uint reserved, out IBindCtx bindCtx);

        [DllImport("ole32.dll")]
        private static extern int GetRunningObjectTable(uint reserved,
            out IRunningObjectTable runningObjectTable);
       
        public static void Main(string[] args)
        {
            var pids = new List<int>();
            var monikers = new IMoniker[1];
           
            GetRunningObjectTable(0, out var rot);
            rot.EnumRunning(out var enumMoniker);

            while (enumMoniker.Next(1, monikers, IntPtr.Zero) == 0)
            {
                CreateBindCtx(0, out var ctx);

                monikers[0].GetDisplayName(ctx, null, out var name);

                if (!name.Contains("Sparx.EA.App")) continue;

                // Get the ProcID of the object instance
                var pid = name.Split(':')[1];
                if (!string.IsNullOrEmpty(pid))
                    pids.Add(int.Parse(pid));
            }
           
            // Write out the EA pids
            foreach (var pid in pids)
            {
                Console.WriteLine("EA Process ID: {0}", pid);
            }
        }
    }
}

4
Hi Alain,

I think there is a bug in your code. The first line below will cause a new instance of EA to start. In this case I think the GetActiveObject call is returning a pointer to the newly started COM object and not the Workaround instance you started interactively that should have your MDG loaded.  As a test can you remove that line and make sure there is only a single instance of EA running - the one that you started interactively.

Code: [Select]
Process externalEaProcess = Process.Start(repositoryFileInfo.FullName)
Some caveats with using GetActiveObject - it will attach to either the first or last instance of EA that has been started.  There is no way for a user to specify which instance to attach too - the behavior is OS/version/build dependent.  If you have multiple instances of EA started this call will give you all kinds of headaches.

Stan.

5
bilon - Is the below what you are trying to do?

Below is VBScript, I have not tried anything similar with the other scripting languages.
Code: [Select]
option explicit

!INC Local Scripts.EAConstants-VBScript

'
' Script Name:
' Author:
' Purpose:
' Date:
'
sub main

dim myObject

set myObject = new MyClass

myObject.Value1 = Repository.ConnectionString
myObject.Value2 = "Hello World!"

Session.Output myObject.Value1
Session.Output myObject.Value2
end sub

'=================================================================
' Define the in memory object
'=================================================================
Class MyClass

private value_1
private value_2

public property get Value1()
Value1 = value_1
end property

public property let Value1(myVal1)
value_1 = myVal1
end property

public property get Value2()
Value2 = value_2
end property

public property let Value2(myVal2)
value_2 = myVal2
end property
End Class

main

6
Automation Interface, Add-Ins and Tools / Re: .NET Repository List
« on: July 10, 2019, 02:27:22 pm »
I just exposed the source for one of my projects that does exactly this.  There are two functions in the library, one identifies and returns a repository object given it's instanceGUID and the other returns a list of all open repositories.

The line of code that filters by instanceGUID can be changed to filter by anything available through the Repository interface.

https://github.com/smend5464/SparxEA

Stan.

7
General Board / Re: transfer project to DBMS
« on: August 10, 2016, 04:06:52 pm »
To add to the questions that might help narrow the issue.


- Do you have all rights on the database or was it set up by someone else who granted you permissions on it?
- Is EA security turned on?
- Is the RDMS server set up to allow multiple users for this database?

What is being described appears to indicate that something (you or another process) has write locks on the tables which are preventing updates.


8
General Board / Re: Share model components between different projects
« on: August 06, 2016, 03:30:28 am »
There is no scripting ability for RAS.  I put in a feature request when it first came out requesting this, however based on the posts I've seen I don't think it has enough momentum yet for this type of request to bubble up.  You should make the feature request though so it gets logged.

Stan.

9
Well Windows does have PowerShell which has pretty much all the same command line tools available in bash - assuming you are using Win 7 or later.  The part that annoys me is that the names and options are all different so I have to use PowerShell ISE and constantly look up equivalents.  Supposedly the upgrade to Win 10 due in a few days will support a native Ubuntu bash shell with access to all the familiar unix command line tools.

10
This might happen if the elements you are missing in the web browser are in a package (or project root) that is not being exported to html.  As the elements are in the same repository the EA client project browser won't have a problem finding and displaying them.

Stan.

11
Bugs and Issues / Re: Cloud Service user
« on: July 07, 2016, 05:55:42 am »
I don't know if its a best practice, however I've used the first option (or variant) proposed in the past i.e. create a local service account that can access the database - assuming the database and cloud service are running on the same machine.  If the database and cloud service are on different machines, you might have to create a domain account as the service account and add it to the security group just like a regular user.

It's probably not a good idea as noted to grant the local system user access to the database.

qwerty, the cloud service exposes the repository via http calls from a web server included with the service.  The web server in turn communicates with a Windows service that connects to the database and runs the actual queries whose results get repackaged back into content for the EA client.

Stan.

12
Bugs and Issues / Re: HTML export on web server
« on: May 14, 2016, 09:09:59 am »
I've used it with IIS before and never had to do any additional work other then copy the root directory where the html gets generated to a folder exposed by IIS.  In my case I had an automated process that generated the html and then copied the root over for IIS to expose.

Stan.

13
I posted a little PowerShell snippet that does exactly this below.

http://sparxsystems.com/forums/smf/index.php/topic,2708.msg222357.html#msg222357

Stan.

14
General Board / Re: Import new tagged value onto component
« on: April 26, 2016, 03:17:29 am »
You might try the csv import functionality.  It was updated over the last couple of versions to allow import of tag values.  You'll need to do something like:
  • Export the GUID, Name, Type of the components to be updated to csv
  • Update the csv to include the new tag values
  • Import the updated file

I haven't looked at Geert's importer in a while but it should be fairly easy to update that to add tag values to existing components as well.

Test offline to catch any specific nuances for your case.

Stan.

15
qwerty pointed how to do this in his post.  I just posted a short powershell script that will do exactly this and can be run from the scheduler.

http://sparxsystems.com/forums/smf/index.php/topic,2708.0.html

Pages: [1] 2 3 ... 10