[gme-users] Java interface: JBuilderModel/getAttribute

Francisco Hernandez hernandf at cis.uab.edu
Thu Apr 14 12:00:26 CDT 2005


Try this:

private void CreateTaskTemplate(JBuilderModel abstractTask) {
....
String firingRule = abstractTask.getIModel().getStrAttrByName("FiringRule");
....
}

Francisco

Amol Bakshi wrote:

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

-- 
----------------------------------------------------------------
Francisco Hernandez
Department of Computer and Information Sciences
University of Alabama at Birmingham
hernandf at cis.uab.edu




More information about the gme-users mailing list