summaryrefslogtreecommitdiff
path: root/tools/state_graph.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-01-21 13:08:33 -0800
committerJoshua Harlow <harlowja@gmail.com>2015-01-22 23:25:35 -0800
commit55ad11f278e2eb4133486fa817eca292ec1fec8a (patch)
treee14d648a6e779a23b57029f62660525fffaef4f0 /tools/state_graph.py
parent292adc5a620f4318d8aa6f7580d66d1010076490 (diff)
downloadtaskflow-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/state_graph.py')
-rwxr-xr-xtools/state_graph.py19
1 files changed, 17 insertions, 2 deletions
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,