Book a Demo

Author Topic: how do I delete a TaggedValue using the automation  (Read 3695 times)

Fred Walter

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
how do I delete a TaggedValue using the automation
« on: October 03, 2011, 11:18:18 pm »
I've written a java program that lets me dump out various bits of information from .eap files.

However I need to be able to delete TaggedValue's from .eap files.

I couldn't find Java-specific documentation for the automation interface to let me delete a TaggedValue - is this documented somewhere?

I did the following:

      unzip /Program\ Files/Sparx\ Systems/ea/Java\ API/eaapi.jar
      for i in org/sparx/*.class ; do javap $(dirname $i)/$(basename $i .class) ; done > eaapi_docs.txt

Looking inside eaapi_docs.txt I see:

Compiled from "TaggedValue.java"
public class org.sparx.TaggedValue extends java.lang.Object{
    org.sparx.TaggedValue(long);
    public org.sparx.TaggedValue(org.sparx.TaggedValue);
    protected void finalize();
    public void destroy();
    long GetComObject();
    public int GetElementID();
    public java.lang.String GetLastError();
    public java.lang.String GetName();
    public java.lang.String GetNotes();
    public org.sparx.ObjectType GetObjectType();
    public int GetParentID();
    public java.lang.String GetPropertyGUID();
    public int GetPropertyID();
    public java.lang.String GetValue();
    public void SetElementID(int);
    public void SetName(java.lang.String);
    public void SetNotes(java.lang.String);
    public void SetPropertyGUID(java.lang.String);
    public void SetValue(java.lang.String);
    public boolean Update();
    static {};
}

I don't see a method/function in the above list, that lets me delete a TaggedValue.

How do I delete a TaggedValue using the automation interface, using Java?

      Thanks,
      Fred

Fred Walter

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: how do I delete a TaggedValue using the automa
« Reply #1 on: October 03, 2011, 11:27:11 pm »
I'm going to try using Delete() from the Collection object, to delete TaggedValue's from .eap files.

Compiled from "Collection.java"
public class org.sparx.Collection extends java.lang.Object implements java.lang.Iterable{
    org.sparx.Collection(long);
    public org.sparx.Collection(org.sparx.Collection);
    protected void finalize();
    public java.lang.Object AddNew(java.lang.String, java.lang.String);
    public void Delete(short);
    public void DeleteAt(short, boolean);
    public void destroy();
    public java.lang.Object GetAt(short);
    public java.lang.Object GetByName(java.lang.String);
    long GetComObject();
    public short GetCount();
    public java.lang.String GetLastError();
    public org.sparx.ObjectType GetObjectType();
    public java.util.Iterator iterator();
    public void Refresh();
    static {};
}

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: how do I delete a TaggedValue using the automa
« Reply #2 on: October 03, 2011, 11:50:53 pm »
heres my c# code to delete a tagged value with a given name from a given element

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: how do I delete a TaggedValue using the automa
« Reply #3 on: October 04, 2011, 07:19:04 pm »
Fred,

Please look into your help file in the section Automation for a full description of the EA object model.

Geert

PS. Yes, Delete() should do the trick.