diff options
| author | Mark Rowe <mark@vector35.com> | 2025-08-11 15:45:38 -0700 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2025-08-20 13:06:33 -0400 |
| commit | ff72f3be107e94a0be41a1e7ba113000a4e95089 (patch) | |
| tree | 1dec15cea9d5b8e5609b1006638fc5cea2eda974 /workflow.cpp | |
| parent | e15b6e8789bd791a201bdac031561dddb59a99e4 (diff) | |
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`.
Diffstat (limited to 'workflow.cpp')
| -rw-r--r-- | workflow.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/workflow.cpp b/workflow.cpp index 13c180a5..3b0366db 100644 --- a/workflow.cpp +++ b/workflow.cpp @@ -454,9 +454,19 @@ vector<Ref<Workflow>> Workflow::GetList() } -Ref<Workflow> Workflow::Instance(const string& name) +Ref<Workflow> 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> Workflow::GetOrCreate(const string& name) +{ + return new Workflow(BNWorkflowGetOrCreate(name.c_str())); } |
