[gme-users] Java interface: JBuilderModel/getAttribute

Brian Williams BrianW at isis.vanderbilt.edu
Thu Apr 14 14:54:40 CDT 2005


Have you tried running the example JavaBON interpreter in the SF example
paradigm? (\GME\Paradigms\SF\JavaBONSFExample)

I also have GME 4.11.10 Running this on the top level model in the
SFDemo provided works for me. Pay attention to SFParam.java and
SFParameterBase.java

Brian Williams

-----Original Message-----
From: Amol Bakshi [mailto:amol.bakshi at gmail.com] 
Sent: Thursday, April 14, 2005 9:38 AM
To: gme-users
Subject: [gme-users] Java interface: JBuilderModel/getAttribute

I am trying to use the Java interface to write a simple model
interpreter that retrieves attribute values of different models and
atoms.  The traversal appears to be working fine but I am having no
success (like some other postings in this list previously) in using
the getAttribute(String, String[]) method.

My code excerpt:

private void CreateTaskTemplate(JBuilderModel abstractTask) {
....
String[] firingRule = new String[4];
boolean success = abstractTask.getAttribute("FiringRule", firingRule);
JOptionPane.showMessageDialog(null, (success?"yes":"no"));
....
}

Notes:
* I tried various sizes of the String array, even tried not
initializing it!!  I expect only one value so I believe just a
String[1] should suffice...
* The value of "success" is false every time.
* I tried using code provided in a prior (April 04) posting in this
list that used MgaAttribute[] array to store the results of
abstractTask.getIObject().getAttributes().getAll(), and traversed the
returned values for a name match with the attribute.  I am not very
familiar with mga so I do not know if something is wrong.
* I tried using a 'fixed' gme.jar posted on this list in 2004; that
didnt' work either.
* I am using GME 4.11.10 in this example.

Is this a real problem and is there a fix/workaround or am I doing
something very stupid?  Not being able to retrieve attribute values
makes my model interpreter entirely useless!  Any help will be greatly
appreciated.

-Amol.
_______________________________________________
gme-users mailing list
gme-users at list.isis.vanderbilt.edu
http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users


More information about the gme-users mailing list