@@ -11307,13 +11307,43 @@ namespace BinaryNinja {
1130711307 */
1130811308 static std::vector<Ref<Workflow>> GetList();
1130911309
11310- /*! Get an instance of a workflow by name. If it is already registered, this will return the registered Workflow.
11311- If not, it will create and return a new Workflow.
11310+ /*! Get an instance of an existing registered workflow by name.
11311+ If no registered workflow exists, nullptr will be returned.
11312+
11313+ \note Be sure to handle the nullptr case if you're retrieving
11314+ anything other than a built-in workflow.
1131211315
1131311316 \param name Workflow name
11314- \return The registered workflow.
11317+ \return The registered workflow, or nullptr if none exists .
1131511318 */
11316- static Ref<Workflow> Instance(const std::string& name = "");
11319+ static Ref<Workflow> Get(const std::string& name);
11320+
11321+ /*! Get an instance of a workflow by name. If it is already registered,
11322+ this will return the registered Workflow. If not, a new Workflow will
11323+ be created and returned.
11324+
11325+ \note If a new workflow is returned it will have no activities. Attempting
11326+ to register new activities on it via `Insert` and `InsertAfter` will fail.
11327+
11328+ \param name Workflow name
11329+ \return The workflow.
11330+ */
11331+ static Ref<Workflow> GetOrCreate(const std::string& name);
11332+
11333+ /*! Get an instance of a workflow by name. If it is already registered,
11334+ this will return the registered Workflow. If not, a new Workflow will
11335+ be created and returned.
11336+
11337+ \deprecated Use `Get` or `GetOrCreate` instead.
11338+
11339+ \note If a new workflow is returned it will have no activities. Attempting
11340+ to register new activities on it via `Insert` and `InsertAfter` will fail.
11341+
11342+ \param name Workflow name
11343+ \return The workflow.
11344+ */
11345+ static Ref<Workflow> Instance(const std::string& name = "") { return GetOrCreate(name); }
11346+
1131711347 /*! Register a workflow, making it immutable and available for use
1131811348
1131911349 \param workflow The workflow to register
0 commit comments