Bug #3529

cannot always set parameters when running workflow from command line

Added by Daniel Crawl almost 14 years ago. Updated about 13 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


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 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 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 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
line argument.

To close this bug, I'd like to be able to invoke a workflow from the command
line and pass it an argument.

Something like:
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.

#3 Updated by Daniel Crawl about 13 years ago

Parameters can now be passed when using -nogui.

Additionally, 'ant startup-script' creates so you don't need to use ant's -Dworkflow= syntax.

#4 Updated by Redmine Admin over 9 years ago

Original Bugzilla ID was 3529

Also available in: Atom PDF