diff options
| author | Joshua Harlow <harlowja@yahoo-inc.com> | 2015-01-21 13:08:33 -0800 |
|---|---|---|
| committer | Joshua Harlow <harlowja@gmail.com> | 2015-01-22 23:25:35 -0800 |
| commit | 55ad11f278e2eb4133486fa817eca292ec1fec8a (patch) | |
| tree | e14d648a6e779a23b57029f62660525fffaef4f0 /tools | |
| parent | 292adc5a620f4318d8aa6f7580d66d1010076490 (diff) | |
| download | taskflow-55ad11f278e2eb4133486fa817eca292ec1fec8a.tar.gz | |
Add a WBE request state diagram + explanation
To make it more clear what the WBE request states are
and what they imply/mean add the appropriate documentation
and diagram that explains it and its states/concepts.
Change-Id: If25b5c6402aff6e294886cc6c5f248413183c4e4
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/generate_states.sh | 4 | ||||
| -rwxr-xr-x | tools/state_graph.py | 19 |
2 files changed, 21 insertions, 2 deletions
diff --git a/tools/generate_states.sh b/tools/generate_states.sh index 2da7581..308c640 100755 --- a/tools/generate_states.sh +++ b/tools/generate_states.sh @@ -30,3 +30,7 @@ $xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/engine_stat echo "---- Updating retry state diagram ----" python $script_dir/state_graph.py -r -f /tmp/states.svg $xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/retry_states.svg + +echo "---- Updating wbe request state diagram ----" +python $script_dir/state_graph.py -w -f /tmp/states.svg +$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/wbe_request_states.svg diff --git a/tools/state_graph.py b/tools/state_graph.py index ce5a1d7..5ba9da7 100755 --- a/tools/state_graph.py +++ b/tools/state_graph.py @@ -27,6 +27,7 @@ sys.path.insert(0, top_dir) import pydot from taskflow.engines.action_engine import runner +from taskflow.engines.worker_based import protocol from taskflow import states from taskflow.types import fsm @@ -91,6 +92,10 @@ def main(): action='store_true', help="use engine state transitions", default=False) + parser.add_option("-w", "--wbe-requests", dest="wbe_requests", + action='store_true', + help="use wbe request transitions", + default=False) parser.add_option("-T", "--format", dest="format", help="output in given format", default='svg') @@ -99,9 +104,15 @@ def main(): if options.filename is None: options.filename = 'states.%s' % options.format - types = [options.engines, options.retries, options.tasks] + types = [ + options.engines, + options.retries, + options.tasks, + options.wbe_requests, + ] if sum([int(i) for i in types]) > 1: - parser.error("Only one of task/retry/engines may be specified.") + parser.error("Only one of task/retry/engines/wbe requests" + " may be specified.") internal_states = list() ordering = 'in' @@ -120,6 +131,10 @@ def main(): source, memory = r.builder.build() internal_states.extend(runner._META_STATES) ordering = 'out' + elif options.wbe_requests: + source_type = "WBE requests" + source = make_machine(protocol.WAITING, + list(protocol._ALLOWED_TRANSITIONS), []) else: source_type = "Flow" source = make_machine(states.PENDING, |
