taskinator icon indicating copy to clipboard operation
taskinator copied to clipboard

Add Process Hooks

Open virtualstaticvoid opened this issue 2 years ago • 0 comments

Adds before_started, after_completed and after_failed functionality.

E.g.

module MyProcess
  extend Taskinator::Definition

  # defines a process
  define_process do

    # define task to execute before process starts
    before_started :slack_notification

    # tasks, sub-process, etc.

    # define task to execute on completion
    after_completed :further_process

    # define task to execute on failure
    after_failed :email_notification

  end

  def slack_notification
    # ...
  end

  def further_process
    # ...
  end

  def email_notification
    # ...
  end

end

virtualstaticvoid avatar Jan 07 '23 17:01 virtualstaticvoid