diff --git a/temporal/workflow.py b/temporal/workflow.py index 3ae54d9..60f059b 100644 --- a/temporal/workflow.py +++ b/temporal/workflow.py @@ -7,12 +7,18 @@ from temporal.activity import calculate_plant_eaf_activity, execute_simulation_a @workflow.defn class SimulationWorkflow: - status = "PENDING" + def __init__(self): + self.status = "INITIALIZED" + self.isDone = False @workflow.query def get_status(self) -> str: return self.status + @workflow.query + def is_done(self) -> bool: + return self.isDone + @workflow.run async def run(self, sim_data: dict) -> str: self.status = "RUNNING" @@ -46,4 +52,5 @@ class SimulationWorkflow: self.status = "COMPLETED" # etc… + self.isDone = True return sim_data["HubCnnId"] # simulation_id