Experiences and rules, sign up creation

 

Here is the code used in this lesson:


Experience SignUp {
    String title value("Create account!") as Label
    String username label("username") as TextField
    String password label("password") as TextField 
    String repeatPassword label("repeat password") as TextField

    Decision createAccount action("SignUpContext.createAccount") label("create account")
}

Experience Welcome {
    String greetings label("Welcome!") as Label
}

RuleContext LoginContext {
    Rule login {
        Login loginExp = broker.ui.getDataSource()
        Welcome welcomeDataSource = Welcome()
        welcomeDataSource.greetings = "Welcome " + loginExp.username + " to the treasure hunt app!"
        broker.ui.push(“Welcome”, welcomeDataSource)
    }
    Rule signUp {
        broker.ui.push(“SignUp”)
    }
}

> Next