Documentation

Route DSL Examples

Examples

Terminal route


route("Finish") {
    uri "/finish"
    terminal()
}

Terminal route with a checkpoint


route("Rejected") {
    uri "/rejected"
    checkpoint()
    terminal()
}

Route with result validation


route("Basic Info") {
    uri "/basic"
    namespace client
    validate {
        firstname
        lastname
        address {
            street
            city { values "Prague", "Paris" }
            zip { regex ~/^[0-9]{5}(?:-[0-9]{4})?$/ }
        }
    }
}

Route exporting a static map


route("Select Product") {
    uri "/product"
    namespace product
    export  product1: "Product 1",
            product2: "Product 2",
            product3: "Product 3"
    validate {
        values "product1", "product2", "product3"
    }
}

Route exporting an attribute


delivery.address << [street: "Dejvicka 18", city: "Prague", zip: 12345]

route("Delivery address") {
    uri "/delivery"
    export address: delivery.address
}

Route registration


register {
    route("Delivery address") {
        uri "/delivery"
        export delivery.address
    }
}

route("Delivery address") {
    export client.address
}