View source for OCLOperators OnStateChange From MDrivenWiki ← OCLOperators OnStateChange OCLOperators OnStateChangeYou do not have permission to edit this page, for the following reason: The action you have requested is limited to users in the group: Users. You can view and copy the source of this page. '''OnStateChange(attrib:String; oldstate:String; newstate:String)''' . Any class with this method signature will get called for each trigger-call that is made on the statemachine. The main intended use is audit and logging functionality. When you use state machines heavily to track important events in your business, this becomes important. The event method is NOT for stopping transitions – use guards for that. You can solve logging by implementing state effects or entry actions as well – but the OnStateChange method helps you pull out generic logging from the state machines. If your class has multiple state machines, state changes from all of these will go through this method. See: [[OnStateChange]] See also: [[OCLOperators OnCreate|OnCreate]], [[OCLOperators OnUpdate|OnUpdate]], [[OCLOperators OnDelete|OnDelete]] [[Category:OCLOperators]] Return to OCLOperators OnStateChange. Retrieved from "https://wiki.mdriven.net/index.php/OCLOperators_OnStateChange"