How do I force the rerun of the app's initial rule?
I have an app that has a login/logout functionality. Upon logout, I am clearing the entity variable. How do I force the app to rerun the开发者_StackOverflow社区 initial rule and display the login form?
You can have the initial rule run again by carefully crafting the select statement of the initial rule. Assuming that you are running the app in the browser, the initial rule fires on web pageview, and the logout click fires a custom logout web event, here is what I would do:
rule initial_rule {
select when web pageview "awesome*Regex(here)" or web logout
pre {
// do cool stuff here
}
{
// fire actions here
}
// postlude block of choice here
}
精彩评论