Skip to content

allow state definition through another component #1

Open
@guilhermesilveira

Description

@guilhermesilveira

In order to... define all possible states and transitions
I want to... allow the user to define a method which "builds" states and returns a list of them so restfulie can allow/block transition transit while executing it:

i.e.:

public List<State> getStates(Restfulie control) {
    control.state("unpaid").allow("cancel");
    return control.getStates();

//
control.state("ready").allow("receive").when(new InventoryAvailabilityOnTheNetwork());
new Dependency() {
public boolean allows(Order order) {
//return order.getStatus()=="payed" && order.getPaymentTime()<1minute;
return true;
}

            })
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions