Skip to content

Commit

Permalink
show comment for start event, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Jan 12, 2024
1 parent 628cecf commit c60ea3c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 428 deletions.
19 changes: 13 additions & 6 deletions lib/trailblazer/workflow/state/discovery/testing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ def self.render_json(states, lanes:, additional_state_data:, initial_lane_positi
resumes = Discovery.resumes_from_suspend(activity, suspend)

resumes_label = resumes.collect do |catch_event|
task_after_catch = activity.to_h[:circuit].to_h[:map][catch_event][Trailblazer::Activity::Right]

Trailblazer::Activity::Introspect.Nodes(activity, task: task_after_catch).data[:label] || task_after_catch
find_next_task_label(activity, catch_event)
end


Expand All @@ -66,15 +64,24 @@ def self.render_json(states, lanes:, additional_state_data:, initial_lane_positi

end


{
start_position: [activity_id, triggered_catch_event_id],
start_position: {
tuple: [activity_id, triggered_catch_event_id],
comment: find_next_task_label(start_position.activity, start_position.task)
},
expected_lane_positions: expected_lane_positions,
}
end

end
end

# Find the next connected task, usually outgoing from a catch event.
def self.find_next_task_label(activity, catch_event)
task_after_catch = activity.to_h[:circuit].to_h[:map][catch_event][Trailblazer::Activity::Right]

Trailblazer::Activity::Introspect.Nodes(activity, task: task_after_catch).data[:label] || task_after_catch
end
end # Testing
end
end
end
Expand Down
Loading

0 comments on commit c60ea3c

Please sign in to comment.