lib/trailblazer/activity/dsl/linear/feature/patch.rb in trailblazer-activity-dsl-linear-1.0.0 vs lib/trailblazer/activity/dsl/linear/feature/patch.rb in trailblazer-activity-dsl-linear-1.1.0
- old
+ new
@@ -1,8 +1,12 @@
class Trailblazer::Activity
module DSL
module Linear
+ def self.Patch(activity, instructions)
+ Patch.customize(activity, options: instructions)
+ end
+
module Patch
# DISCUSS: we could make this a generic DSL option, not just for Subprocess().
# Currently, this is called from the Subprocess() helper.
def self.customize(activity, options:)
options = options.is_a?(Proc) ?
@@ -19,10 +23,10 @@
def self.call(activity, path, customization)
task_id, *path = path
patch =
if task_id
- segment_activity = Introspect::Graph(activity).find(task_id).task
+ segment_activity = Introspect::TaskMap(activity).find_by_id(task_id).task
patched_segment_activity = call(segment_activity, path, customization)
# Replace the patched subprocess.
-> { step Subprocess(patched_segment_activity), inherit: true, replace: task_id, id: task_id }
else