The Concepts : Events

Events are objects which tell the ActionFlow framework what to do next once a step is complete. Although the event name is entirely up to the developer, some event names are reserved. See below for more details.

Sample Usage

Every step definition has to return an event. An event can be returned as follows.

 def init
 
   # Nothing to do, just a sample after all...
   # Let's just send a 'success' event.
   event :success
   
 end

The init method returns the success event, which will be interpreted according to the corresponding mapping.

 action_step :init do
  
   # Tells what to do when the 'success' event is returned
   on :success => :display_something
  
 end

In this situation, the success event means that the display_something step will be called next.

Reserved events

The following event names are used internally and cannot be returned by the step definitions.

  • render

The render event

The render event instructs the ActionFlow framework to transfer the execution to the view rendering mechanism. Usually, it is returned by a View Step, but it can be returned by any other step type as needed.

~~DISCUSSION~~

 
event.txt · Last modified: 2007/06/06 16:21 by lucboudreau
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License.