Creation for user model and rule for user registration “sign up”


Here is the code used in this lesson:

Model User {
    String name
    String password
    Integer score value(0)

RuleContext SignUpContext {
    Rule createAccount {
        SignUp signUpExp = broker.ui.getDataSource()
        User newUser = User() = signUpExp.username
        newUser.password = signUpExp.password
        broker.ui.showAlert("Congratulations!", "Your account has been created successfully, please login now.")

> Next