[kepler-dev] Adding actors to the workflow programmatically

Christopher Brooks cxh at eecs.berkeley.edu
Thu Jan 10 11:27:01 PST 2008

Hi R.P.,

If you have a model, then you can instantiate the actor into
the model with the constructor for the actor that takes a container.
However, you need to handle actor name duplication issues yourself.

The biggest problem is that undo/redo will not work, since undo/redo
uses ChangeRequests.

This also gets into configurations, effigies and tableaux.  See
the following classes ptolemy.actor.gui: Configuration, Effigy,

Ptolemy models can be described in MoML, Java and Tcl.  For examples
of models in Java, see the .java classes in ptolemy/domains/*/demo/*,
for example


Edward writes:

    When you drag an actor in, the outline of what happens is:
      actor = the selected actor in the library;
      String xml = actor.exportMoML();
      model = the composite actor being edited.
      MoMLChangeRequest request = new MoMLChangeRequest(..., xml, ...);
    I.e., a MoML description of the actor to drop in is obtained,
    and a change request is used to insert that MoML into the model.
    At 04:05 AM 1/10/2008, R.P.Mciver at cs.cardiff.ac.uk wrote:
    >I've been playing about with trying to add Actors to a workflow in a  
    >manner different to dragging them from the tree of those available,  
    >however I've not been having much luck!
    >I was wondering if anyone could tell me what code is actually executed  
    >when the user drags an entity from the tree onto the workflow? And is  
    >there a simple "addEntity" command that could be used to add an actor  
    >to an existing workflow?
    >Thanks in advance to anyone who can help!
    >This message was sent using IMP, the Internet Messaging Program.
    >Kepler-dev mailing list
    >Kepler-dev at ecoinformatics.org
    Edward A. Lee
    Chair of EECS and Robert S. Pepper Distinguished Professor
    231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
    phone: 510-642-0253, fax: 510-642-2845
    eal at eecs.Berkeley.EDU, http://www.eecs.berkeley.edu/Faculty/Homepages/lee.h
    Kepler-dev mailing list
    Kepler-dev at ecoinformatics.org

More information about the Kepler-dev mailing list