cannot always set parameters when running workflow from command line
When -nogui is used, MoMLSimpleApplication loads and runs the workflow. This class does not support setting model parameters. (This functionality exists in MoMLApplication, so maybe the code to set parameters could be split out).
#1 Updated by Christopher Brooks almost 14 years ago
I'll take this one. Maybe MoMLSimpleApplication is not the
place for this, since it makes the application not so simple.
Currently, MoMLSimpleApplication is in ptolemy.moml because it does not
require the Configuration and other classes that are used by MoMLApplication
MoMLApplication has a homegrown way of handling command line arguments where
the arguments are parsed by the current class and if the argument is not parsed
by the current class, then the argument is parsed by the parent class.
The problem here is that MoMLSimpleApplication and MoMLApplication both extend
Object. So, we would need to a different implementation so as to avoid code
#2 Updated by Christopher Brooks over 13 years ago
I've created ptolemy.moml.MoMLCommandLineApplication, which
takes command line arguments that update the parameters.
for further discussion.
I looked at refactoring the code, and it would be a big job. Probably
ptolemy.actor.gui.MoMLApplication should extend a class in ptolemy.moml that
provides the basic infrastructure. The amount of code duplication in
this new class is fairly small. If this was to be avoided, we would want
ptolemy.actor.gui.MoMLApplication to call a utility function. However,
this would increase complexity.
However, there are issues in the devel tree:
was way out of date. There is no kepler.sh or kepler file in my tree.
I added some text at the bottom that describes the current situation.
2) There is discussion at
about how to run from the command line, but I'm not sure how to pass a command
To close this bug, I'd like to be able to invoke a workflow from the command
line and pass it an argument.
ant run-workflow-no-gui -Dworkflow=/Users/cxh/ptII/ptolemy/moml/test/MoMLCommandLineApplicationTest.xml -DmyParameter=2
BTW - I really don't like the -Dworkflow= syntax. We should probably
have a kepler script that buries this from the user.