| 702 | return st2_ctx |
| 703 | |
| 704 | def prep_wf_ex(self, wf_ex_db): |
| 705 | data = { |
| 706 | "spec": wf_ex_db.spec, |
| 707 | "graph": wf_ex_db.graph, |
| 708 | "input": wf_ex_db.input, |
| 709 | "context": wf_ex_db.context, |
| 710 | "state": wf_ex_db.state, |
| 711 | "output": wf_ex_db.output, |
| 712 | "errors": wf_ex_db.errors, |
| 713 | } |
| 714 | |
| 715 | conductor = conducting.WorkflowConductor.deserialize(data) |
| 716 | conductor.request_workflow_status(wf_statuses.RUNNING) |
| 717 | |
| 718 | for task in conductor.get_next_tasks(): |
| 719 | ac_ex_event = events.ActionExecutionEvent(wf_statuses.RUNNING) |
| 720 | conductor.update_task_state(task["id"], task["route"], ac_ex_event) |
| 721 | |
| 722 | wf_ex_db.status = conductor.get_workflow_status() |
| 723 | wf_ex_db.state = conductor.workflow_state.serialize() |
| 724 | wf_ex_db = wf_db_access.WorkflowExecution.update(wf_ex_db, publish=False) |
| 725 | |
| 726 | return wf_ex_db |
| 727 | |
| 728 | def get_task_ex(self, task_id, route): |
| 729 | task_ex_dbs = wf_db_access.TaskExecution.query( |