From 45e741822f3b67e400297e851202216136a5604b Mon Sep 17 00:00:00 2001 From: zhang_lu Date: Fri, 22 Nov 2024 17:47:30 +0800 Subject: [PATCH 1/2] fix start_workflow_by_name function in OrkesWorkflowClient --- .../engine/orkes/orkes_workflow_client.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py b/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py index a5bb33c..b89c9c0 100644 --- a/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py +++ b/omagent-core/src/omagent_core/engine/orkes/orkes_workflow_client.py @@ -27,18 +27,14 @@ def start_workflow_by_name( name: str, input: dict[str, object], version: Optional[int] = None, - correlationId: Optional[str] = None, - priority: Optional[int] = None, + **kwargs ) -> str: - kwargs = {} - if version: - kwargs.update({"version": version}) - if correlationId: - kwargs.update({"correlation_id": correlationId}) - if priority: - kwargs.update({"priority": priority}) - - return self.workflowResourceApi.start_workflow1(input, name, **kwargs) + start_workflow_request = StartWorkflowRequest(name=name, + version=version, + input=input, + **kwargs) + + return self.start_workflow(start_workflow_request) def start_workflow(self, start_workflow_request: StartWorkflowRequest) -> str: return self.workflowResourceApi.start_workflow(start_workflow_request) From 451d9941dafe98a34fc61b2453eb1e272e330005 Mon Sep 17 00:00:00 2001 From: zhang_lu Date: Fri, 22 Nov 2024 18:00:21 +0800 Subject: [PATCH 2/2] Remove unnecessary arg workflow_instance_id in abstractmethod _run in BaseWorker --- omagent-core/src/omagent_core/engine/worker/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omagent-core/src/omagent_core/engine/worker/base.py b/omagent-core/src/omagent_core/engine/worker/base.py index e2869a0..c3e898b 100644 --- a/omagent-core/src/omagent_core/engine/worker/base.py +++ b/omagent-core/src/omagent_core/engine/worker/base.py @@ -78,7 +78,7 @@ def workflow_instance_id(self, value: str): self._workflow_instance_id = value @abstractmethod - def _run(self, workflow_instance_id, *args, **kwargs) -> Any: + def _run(self, *args, **kwargs) -> Any: """Run the Node.""" def execute(self, task: Task) -> TaskResult: