Skip to content

Commit

Permalink
move Generate to Parse. much better name.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Apr 19, 2024
1 parent 885b949 commit b752375
Show file tree
Hide file tree
Showing 4 changed files with 679 additions and 678 deletions.
2 changes: 1 addition & 1 deletion lib/trailblazer/workflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Workflow
end
end

require "trailblazer/workflow/generate"
require "trailblazer/workflow/parse"
require "trailblazer/workflow/collaboration"
require "trailblazer/workflow/collaboration/lane"
require "trailblazer/workflow/collaboration/messages"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module Trailblazer
module Workflow
# Computes a {Intermediate} data structures for every lane from a TRB PRO/editor .json file.
class Generate < Trailblazer::Activity::Railway
class Parse < Trailblazer::Activity::Railway
Element = Struct.new(:id, :type, :data, :links, :label)
Link = Struct.new(:target_id, :semantic)

Expand Down Expand Up @@ -89,13 +89,13 @@ def self.compile_intermediate(ctx, lane:, start_event:, termini_map:, **)
ctx[:value] = [lane.id, intermediate]
end

step Generate.method(:transform_from_json), id: :transform_from_json
step Parse.method(:transform_from_json), id: :transform_from_json
step Each(dataset_from: :lanes, item_key: :lane, collect: true) {
step Generate.method(:find_start_event), id: :find_start_event
fail Generate.method(:default_start_event), id: :default_start_event,
step Parse.method(:find_start_event), id: :find_start_event
fail Parse.method(:default_start_event), id: :default_start_event,
Output(:success) => Track(:success)
step Generate.method(:compute_termini_map), id: :compute_termini_map
step Generate.method(:compile_intermediate), id: :compute_intermediate
step Parse.method(:compute_termini_map), id: :compute_termini_map
step Parse.method(:compile_intermediate), id: :compute_intermediate
}, Out() => ->(ctx, collected_from_each:, **) { {intermediates: collected_from_each.to_h} } #{:collected_from_each => :intermediates}
end
end
Expand Down
Loading

0 comments on commit b752375

Please sign in to comment.