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 - Chris Allport

Pages: [1]
1
Bugs and Issues / Re: Scripting engine seems to "cache" parts of scr
« on: October 23, 2014, 03:44:14 am »
This has happened to me many times.  In the past, I have recovered by restarting EA, but a completely unrelated scripting problem indicated that you might be able to recover by killing off the SScripter process and trying again.

2
From what I can find, X-types was not approved until 2012.  The plugin seems to predate that.  Furthermore, even though ddsgen can properly compile the IDL into objects, that does not meet that polymorphism works through DDS.  My understanding is that DDS topics are bound to a single concrete type.  Although this may change, this potentially breaks one of the pillars of DDS.  By not constantly allocating memory (which is possible when the type is fixed), the memory does not fragment over time.  This is a significant concern in high volume (many million messages per second) systems - particularly when the garbage collector cannot keep up.

3
Is there a way to get relationships (generalization/specialization) to be reflected in generated IDL code?  Our model is generated by importing an XSD and there are a number of relationships that the IDL does not appear to reflect.

We have tried a couple of generalizations, but the generated code does not reflect this relationship.  Is there a particular stereotype/rolename/etc missing?

Thanks!


4
Automation Interface, Add-Ins and Tools / Re: Script that Deletes Packages
« on: November 05, 2014, 08:43:29 am »
So far so good.  The package is now renamed to "_deleting_" + pkg.Name before I delete it.  Relatively low chance of collision with a name like that.  

Anyway, oddly enough, EA hasn't thrown this error on me in a couple of days now.  I did restart EA before and it didn't go away...so the script must be getting lucky.

Thanks for the help!

5
Automation Interface, Add-Ins and Tools / Re: Script that Deletes Packages
« on: November 04, 2014, 08:39:31 am »
Sometimes, but sometimes it appears during script execution.

A little more about what I am doing.  I am creating a processed copy of the model in another package.  When a user goes to run the script again, if they use the same name for the duplicate package, it removes the old package and then creates a new package with the same name.  

6
Automation Interface, Add-Ins and Tools / Re: Script that Deletes Packages
« on: November 04, 2014, 02:08:27 am »
Postponing is a great suggestion, but what I am trying to overcome is the "underlying model has changed" warning that pops up mid-script run. For now, I am just clearing that error and the script continues.

7
Automation Interface, Add-Ins and Tools / Re: Script that Deletes Packages
« on: November 03, 2014, 01:32:43 pm »
Continuing the thread:

Thank you, but I do not really see the difference in this code (except only refreshing the parent), this still reloads the whole model if the package is hanging off the root package. [In this case, Package ID of parent is 0.]  Also, DeleteAt does not appear to make a difference [I implemented with this the first time through] - the second parameter (refresh) is documented as not being implemented.

8
Automation Interface, Add-Ins and Tools / Script that Deletes Packages
« on: November 01, 2014, 07:17:03 am »
Hi, All-

I have a method that deletes a package.  The problem is that the Project Browser is never refreshed.  The only thing that seems to work is calling Repository.RefreshModelView(0), but that reopens the model and kills script execution.

Here is the method:

Code: [Select]
function clearPackage( pkg ) {
      var parent as EA.Package;
      parent = Repository.GetPackageByID(pkg.ParentID);
      
      var pkgList as EA.Collection;
      pkgList = parent.Packages;

       for (var i = 0; i < pkgList.Count; i++) {
             var p as EA.Package;
            p = pkgList.GetAt(i);
            
            if (p.PackageGUID == pkg.PackageGUID) {
                   pkgList.Delete(i);
                   pkgList.Refresh();
                   parent.Update();  // have tried with and without
                  return;
            }
      }
}


Inspecting pkgList.Count before and after pkgList.Refresh does show a change in size.  Again, the problem seems limited to the Project Browser.

Any ideas on how to refresh the Project Browser?

(Cross post: http://stackoverflow.com/questions/26682852/project-browser-not-updating-with-package-deletion-script)

9
Wow.  Thanks!

I did try that and, for some reason, it didn't seem to work.  I just tried it again and bingo.

Thanks again!

Chris

10
In our model, we have adopted the convention of adding Hyperlinks to other diagrams to facilitate navigation.  Now, I am trying to automate this process.

Thanks to this thread (http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1373982154), I was able to figure out how to do it in Python.  Repository.Execute(...) did the trick.

However, I am trying to implement the script inside of EA using JScript.  Execute is not available via Repository.  And SQLQuery seems to be limited to queries only.

Any ideas?  Thanks in advance!

Chris


11
Thank you.  This worked.

For others:

Element e = pkg.GetElement();
Collection<TaggedValue> taggedValues = e.GetTaggedValues();  // They're in here!

12
My model has a package with tagged values, but the automation interface does not have a "GetTaggedValues" method for the package object.

Is it at all possible to access the tagged value data in the package?

Thanks,

Chris

Pages: [1]