How do I force the rerun of the app's initial rule?

34 Views Asked by At

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?

1

There are 1 best solutions below

1
Mike Grace On

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
}