简体   繁体   中英

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 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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM