diff --git a/taskflow/engines/action_engine/engine.py b/taskflow/engines/action_engine/engine.py index e63aeb31..3bdbfd74 100644 --- a/taskflow/engines/action_engine/engine.py +++ b/taskflow/engines/action_engine/engine.py @@ -71,15 +71,17 @@ class ActionEngine(base.EngineBase): self._change_state(states.SUSPENDING) @property - def execution_graph(self): - """The graph of nodes to be executed. + def compilation(self): + """The compilation result. - NOTE(harlowja): Only accessible after compilation has completed. + NOTE(harlowja): Only accessible after compilation has completed (None + will be returned when this property is accessed before compilation has + completed successfully). """ - g = None if self._compiled: - g = self._compilation.execution_graph - return g + return self._compilation + else: + return None def run(self): with lock_utils.try_lock(self._lock) as was_locked: diff --git a/taskflow/engines/action_engine/graph_analyzer.py b/taskflow/engines/action_engine/graph_analyzer.py index 7ca7182f..2e910f6b 100644 --- a/taskflow/engines/action_engine/graph_analyzer.py +++ b/taskflow/engines/action_engine/graph_analyzer.py @@ -31,10 +31,6 @@ class GraphAnalyzer(object): self._graph = graph self._storage = storage - @property - def execution_graph(self): - return self._graph - def get_next_nodes(self, node=None): if node is None: execute = self.browse_nodes_for_execute() diff --git a/taskflow/tests/unit/test_action_engine.py b/taskflow/tests/unit/test_action_engine.py index fa9f3de5..533b5eef 100644 --- a/taskflow/tests/unit/test_action_engine.py +++ b/taskflow/tests/unit/test_action_engine.py @@ -509,7 +509,7 @@ class EngineGraphFlowTest(utils.EngineTestBase): engine = self._make_engine(flow) engine.compile() - graph = engine.execution_graph + graph = engine.compilation.execution_graph self.assertIsInstance(graph, gr.DiGraph) def test_task_graph_property_for_one_task(self): @@ -517,7 +517,7 @@ class EngineGraphFlowTest(utils.EngineTestBase): engine = self._make_engine(flow) engine.compile() - graph = engine.execution_graph + graph = engine.compilation.execution_graph self.assertIsInstance(graph, gr.DiGraph)