Created
April 15, 2010 14:57
-
-
Save bokmann/367181 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class YourTypicalWorkitem < ActiveRecord::Base | |
include StonePath | |
stonepath_workitem do | |
aasm_initial_state :data_entry | |
aasm_state :data_entry | |
aasm_state :data_validation | |
aasm_state :further_processing | |
aasm_event :validate_data do | |
transitions :to => :data_validation, | |
:from => :data_entry | |
end | |
aasm_event :kickback do | |
transitions :to => :data_entry, | |
:from => :data_validation, | |
:on_transition => :handle_kickback | |
end | |
aasm_event :approve do | |
transitions :to => :further_processing, | |
:from => :data_validation | |
end | |
end | |
def handle_kickback(reason) | |
# do something here with the reason you have been passed | |
puts "Reason Provided: #{reason}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment