Deployment modes

By default actions are available irrespective of the deployment mode. The restrictTo() element specifies whether the action should instead be restricted to only available in prototyping mode.

For example:

public class Customer {

    @Action
    public Order placeNewOrder() {
        // ...
    }
    @Action(semantics=SemanticsOf.SAFE)
    public List<Order> listRecentOrders() {
        // ...
    }

    @Action(restrictTo=RestrictTo.PROTOTYPING)      (1)
    public List<Order> listAllOrders() {
        // ...
    }
    ...
}
1 Only visible in prototype mode.

In this case the listing of all orders (in the listAllOrders() action) probably doesn’t make sense for production; there could be thousands or millions. However, it would be useful to disaply how for a test or demo system where there are only a handful of orders.