Skip to content

Commit 47f5c67

Browse files
committed
[Rust] Update the workflow example following API changes
1 parent 64633f6 commit 47f5c67

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

rust/examples/workflow.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ pub fn main() {
5252
binaryninja::headless::Session::new().expect("Failed to initialize session");
5353

5454
println!("Registering workflow...");
55-
let old_meta_workflow = Workflow::get("core.function.metaAnalysis");
56-
let meta_workflow = old_meta_workflow.clone_to("core.function.metaAnalysis");
5755
let activity = Activity::new_with_action(RUST_ACTIVITY_CONFIG, example_activity);
58-
meta_workflow.register_activity(&activity).unwrap();
59-
meta_workflow.insert("core.function.runFunctionRecognizers", [RUST_ACTIVITY_NAME]);
60-
// Re-register the meta workflow with our changes.
61-
meta_workflow.register().unwrap();
56+
// Update the meta-workflow with our new activity.
57+
Workflow::cloned("core.function.metaAnalysis")
58+
.expect("Couldn't find meta workflow")
59+
.activity_after(&activity, "core.function.runFunctionRecognizers")
60+
.expect("Couldn't find runFunctionRecognizers")
61+
.register()
62+
.expect("Couldn't register activity");
6263

6364
println!("Loading binary...");
6465
let bv = headless_session

0 commit comments

Comments
 (0)