# this is a generated file. Don't modify it directly, since it will probably be regenerated later

class <%= classy_name(name) %>Process < Bizflow::BusinessProcess

@dir = File.expand_path(__dir__)

StartAction = "<%= start_action %>"

Actions = {
<%- automated_actions.each do |_, blck| -%>
  <%= blck.name %>: {
    type: "auto",
    description: "<%= blck.description %>",
    handler: Handlers::<%= classy_name(blck.handler.namespace) %>::<%= classy_name(blck.handler.name) %>,
    next_actions: {
    <%- blck.next_actions.each do |k, v| -%>
      <%= k %>: "<%= v %>",
    <%- end -%>
    }
  },
<%- end -%>
<%- task_actions.each do |_, blck| -%>
  <%= blck.name %>: {
    type: "task",
    description: "<%= blck.description %>",
    next_action: "<%= blck.next_action %>",
    tasks: [<%= blck.tasks.map {|t| ":#{t.name}"}.join(", ") %>]
  },
<%- end -%>
}

Tasks = {
<%- tasks.each do |task| -%>
  <%= task.name %>: {
    description: "<%= task.description %>",
    roles: <%= task.roles %>
  },
<%- end -%>
}

def start_action
  StartAction
end

def actions
  Actions
end

def tasks
  Tasks
end

end