<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -41,7 +41,17 @@ for those will be:
 	after[state]Action:  Fires just after the state becomes current
 	exit[state]Action:   Fires on the previous state just after the new
 											 state becomes current (i.e. when you leave this state)
-													
+
+-- Persistence --
+
+Without specifying a persistence object (service layer), the state property
+is updated but not persisted to the database. Obviously, this has a limiting
+effect on events. An after event will fire after the state is updated even 
+though it will not be changed in the database.
+
+To get the proper use of the event callbacks, you should pass in a persistence
+object which will be passed the the business object and is responsible for 
+saving it. 							
 
 === EXAMPLE ===
 
@@ -50,18 +60,30 @@ for those will be:
 		&lt;cffunction name=&quot;setState&quot; ...
 	&lt;/cfcomponent&gt;
 
+	&lt;!--- This is optional, but needed for persistence ---&gt;
+	&lt;cfcomponent displayname=&quot;OrderService&quot; extends=&quot;shade.StateMachine&quot; output=&quot;false&quot;&gt;
+		&lt;cffunction name=&quot;save&quot;&gt;
+			&lt;cfarguments name=&quot;order&quot; ...
+		 	...perform the save
+		&lt;/cffunction&gt;
+	&lt;/cfcomponent&gt;
+
 	&lt;cfcomponent displayname=&quot;StatefulOrder&quot; extends=&quot;shade.StateMachine&quot; output=&quot;false&quot;&gt;
 		&lt;cfset instance = structNew() /&gt;
 		
 		&lt;cffunction name=&quot;init&quot; access=&quot;public&quot; returntype=&quot;any&quot; output=&quot;false&quot;&gt;
 			&lt;cfargument name=&quot;order&quot; required=&quot;true&quot; /&gt;
+			&lt;cfargument name=&quot;persistenceObject&quot; required=&quot;false&quot; /&gt;	
 			&lt;!--- 
 			Call super passing the original business object and the initial state.
 			You can also pass the method to set the state in your business object (without 
 			the get/set in front of it). It defaults to 'State' which would them 
 			assume that you business object had getState() and setState() methods.
 			---&gt;
-			&lt;cfset super.init(arguments.order, 'new') /&gt;
+			&lt;cfset super.init(arguments.order, 'new', 'State', arguments.persistenceObject, 'save') /&gt;
+			&lt;!---
+			or &lt;cfset super.init(arguments.order, 'new') /&gt; if there is no persistence object 
+			---&gt;
 			&lt;cfreturn this /&gt;
 		&lt;/cffunction&gt;
 			</diff>
      <filename>README</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0bdacba1386989f5809b763877b67038f0bf609a</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Wood</name>
    <email>ryan.wood@gmail.com</email>
  </author>
  <url>http://github.com/ryanwood/shade/commit/b2457504eeba4e0ece295659fa26bc6ad909fba0</url>
  <id>b2457504eeba4e0ece295659fa26bc6ad909fba0</id>
  <committed-date>2008-10-13T07:39:46-07:00</committed-date>
  <authored-date>2008-10-13T07:39:46-07:00</authored-date>
  <message>Updated README</message>
  <tree>0f86abde1f9ddcba0121b546234378d0f66a8e05</tree>
  <committer>
    <name>Ryan Wood</name>
    <email>ryan.wood@gmail.com</email>
  </committer>
</commit>
