Author Topic: Incorrect object model, or bad documentation?  (Read 1044 times)

Bjorn S

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Incorrect object model, or bad documentation?
« on: August 30, 2011, 12:26:06 am »
I am using EA version 9, build 906.

Is there a documentation on the Javascript / JScript scripting available, and if so, where? I find that the object model described in the JDK doesn't always correspond to what EA works with or what the IDE in EA describes for the object. Say I select a package in the project that has several sub-packages, and run the following simple script:

---- 8< ----
!INC Local Scripts.EAConstants-JScript

var e = Repository.GetTreeSelectedObject();
Session.Output("elem type: " + e.ObjectType);

var pkg as EA.Package;
pkg = e;
Session.Output("pkg type: " + pkg.ObjectType);
var pkgs as EA.Collection;
pkgs = pkg.Packages;
Session.Output("pkgs type: " + pkgs.ObjectType);
var count = pkgs.Count;
Session.Output("count: " + count);
---- 8< ----

... I get the following output:

---- 8< ----
elem type: 5      
pkg type: 5      
pkgs type: 3      
---- 8< ----

I.e. execution stops at trying to get the Count from a Packages object - the type value of 5 is otPackage, 3 is otCollection - with no error message or other indication that something is wrong. How may I go about getting information about an element and it's child elements? I.e. where is a better and more complete documentation that the Enterprise Architect User Guide and the auto-complete suggestions from the EA Script IDE?

Thanks,

Bjorn.


« Last Edit: August 31, 2011, 04:39:24 pm by bjornsol »

Bjorn S

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Incorrect object model, or bad documentation?
« Reply #1 on: August 31, 2011, 07:20:10 pm »
This was running under Linux. I just ran the same thing in EA under Windows XP, same EA version, and it works fine. Is there something wrong with the Linux version in terms of the object model and/or scripting implementation?

Thanks,

Bjorn.

Bjorn S

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Incorrect object model, or bad documentation?
« Reply #2 on: September 12, 2011, 07:58:49 pm »
It would be interesting to hear whether this is a known limitation to the Linux version or if it's a bug that is being worked on. Or am I the only one seeing this problem?

Thanks,

Bjorn.