From ff72f3be107e94a0be41a1e7ba113000a4e95089 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Mon, 11 Aug 2025 15:45:38 -0700 Subject: Deprecate Workflow::Instance in favor of Workflow::Get and Workflow::GetOrCreate Calls to `Workflow::Instance` that were looking up a built-in workflow name are updated to use `Workflow::Get`. Others use `Workflow::GetOrCreate`. --- workflow.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'workflow.cpp') diff --git a/workflow.cpp b/workflow.cpp index 13c180a5..3b0366db 100644 --- a/workflow.cpp +++ b/workflow.cpp @@ -454,9 +454,19 @@ vector> Workflow::GetList() } -Ref Workflow::Instance(const string& name) +Ref Workflow::Get(const string& name) { - return new Workflow(BNWorkflowInstance(name.c_str())); + auto result = BNWorkflowGet(name.c_str()); + if (!result) + return nullptr; + + return new Workflow(result); +} + + +Ref Workflow::GetOrCreate(const string& name) +{ + return new Workflow(BNWorkflowGetOrCreate(name.c_str())); } -- cgit v1.3.1