The intent of this feature is to allow the developer to add a result that alters the process flow. Take an event requiring authentication, for example.
The process would be: - User accesses an event requiring administration permissions. - Model Glue code verifies user has required permission. - If user has required permission, the Event Handler completely executes giving user access to secured page. - If user does not have required permission, user is redirected to the login page. The use of Result w/ Redirect=True immediately stops processing and transports user to log in page. So the result with redirect=true is used to halt the normal processing of the event flow. If this did not happen, or if it happened after the event was rendered, your unsecured user would be accessing secured event parts. For documentation: http://docs.model-glue.com/wiki/ReferenceMaterials/ModelGlueXmlReference#result Note the optional Redirect parameter notes.... Make sense? On Tue, Jul 26, 2011 at 1:20 PM, Irvin Wilson <[email protected]> wrote: > I just learned something that I'd like to make sure I understand. (mg > 3.1) > > If you use arguments.event.addResult("blah") anywhere in a controller > it appears that execution stops for that controller. At least that's > the case if redirect="true" is set in the modelglue.xml results entry. > > If this is correct I guess I'm wondering why. My controller is > calling a model cfc that adds a record. I then check for success. > Regardless of whether I succeed or fail I want to do a couple of other > things prior to return. These don't fire. I tested by putting in > cfabort immediately before and then after the addResult. Before will > halt. After gets ignored so addResult is definitely returning to > modelglue.xml and ignoring what comes after. > > I guess I can just set a var or two with values based on success or > failure and then do addResult at the bottom but seems clumsy. > > Am I looking at this the wrong way? > > Thank you! > > Irv Wilson > > > PS. I did find an entry several years old using older version of mg > where the poster was showing that entry order was important (set value > prior to set result) for the same reason. It just seems odd. Seems > cfreturn would return whatever result messages are set. Having them > go back prematurely seems like a bug although I'm sure it's > intentional. thx. > > > > -- > Model-Glue Sites: > Home Page: http://www.model-glue.com > Documentation: http://docs.model-glue.com > Bug Tracker: http://bugs.model-glue.com > Blog: http://www.model-glue.com/blog > > You received this message because you are subscribed to the Google > Groups "model-glue" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/model-glue?hl=en -- Plutarch - "The mind is not a vessel to be filled but a fire to be kindled." -- Model-Glue Sites: Home Page: http://www.model-glue.com Documentation: http://docs.model-glue.com Bug Tracker: http://bugs.model-glue.com Blog: http://www.model-glue.com/blog You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en
