-
Notifications
You must be signed in to change notification settings - Fork 0
Utilities
Wiki Updater edited this page Jun 3, 2025
·
2 revisions
Flow offers a number of utilities which allow you to tap into and extend it's functionality.
Flow supports extensive callback functionality.
class ExampleFlow < ApplicationFlow
before_trigger :callback_method
after_trigger :callback_method
around_trigger :callback_method
before_operations :callback_method
after_operations :callback_method
around_operations :callback_method
before_each_operation :callback_method
after_each_operation :callback_method
around_each_operation :callback_method
before_operation OperationClassName, :callback_method
after_operation OperationClassName, :callback_method
around_operation OperationClassName, :callback_method
endFlow includes memoization functionality for operations.
class ExampleOperation < Operation
before_execute :callback_method, memoized: true
endFlow includes the very awesome ShortCircuIt gem for memoization.
All Flows, Operations and States benefit from included utilities.
All Flow objects receive logging methods.
class ExampleOperation < Operation
def execute
log_info { "This is logged at the info level" }
end
endFlow includes the Technologic gem for logging.
The gem adds methods to Flows, Operations, and States which share names with log levels.
log_trace
log_debug
log_info
log_warn
log_error
log_fatalThere are also accompanying query methods:
log_trace?
log_debug?
log_info?
log_warn?
log_error?
log_fatal?