From 54990215c2ad8bda17de857a7fe97d9a7559364f Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Sun, 27 Apr 2025 10:29:51 -0400 Subject: Add initial Workflow Monitor UI and support for nested subflows. --- python/workflow.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'python/workflow.py') diff --git a/python/workflow.py b/python/workflow.py index d118b9f5..ba20591f 100644 --- a/python/workflow.py +++ b/python/workflow.py @@ -643,31 +643,27 @@ class WorkflowMachine: return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) def configure(self, advanced: bool = True, incremental: bool = False): - request = json.dumps({"command": "configure", "advanced": advanced, "incremental": incremental}) if self.is_function_machine: + request = json.dumps({"command": "configure", "advanced": advanced, "incremental": incremental}) return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) else: + request = json.dumps({"command": "configure"}) return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) - def resume(self): - request = json.dumps({"command": "run"}) + def resume(self, advanced: bool = True, incremental: bool = False): if self.is_function_machine: + request = json.dumps({"command": "resume", "advanced": advanced, "incremental": incremental}) return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) else: + request = json.dumps({"command": "resume"}) return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) - def run(self): - status = self.status() - if 'machineState' in status and 'state' in status['machineState']: - if status['machineState']['state'] == 'Idle': - self.configure() - else: - raise AttributeError("Unknown status response!") - - request = json.dumps({"command": "run"}) + def run(self, advanced: bool = True, incremental: bool = False): if self.is_function_machine: + request = json.dumps({"command": "run", "advanced": advanced, "incremental": incremental}) return json.loads(core.BNPostWorkflowRequestForFunction(self.handle, request)) else: + request = json.dumps({"command": "run"}) return json.loads(core.BNPostWorkflowRequestForBinaryView(self.handle, request)) def halt(self): @@ -783,8 +779,8 @@ class WorkflowMachineCLI(cmd.Cmd): "l": "log", "m": "metrics", "d": "dump", - "c": "resume", "r": "run", + "c": "resume", "h": "halt", "s": "step", "b": "breakpoint", -- cgit v1.3.1