springspring-bootspring-statemachineapplication-framework

Design of state machine logic in REST application


I am trying to finalize desgin for my use case of a REST application. It is like a online order application where it will accept the order details, process it and and once processing is finished it will update the status in datbase. during fulfilling there can be multiple task which will be invoked. There will be another REST end point which will be used to get the status of order.

So there will be state transaction like below

Received --> Fulfilling --> Fulfilled

I stumble upon spring-statemachine framework and looks interesting. Considering above use case is spring-statemachine right choice for it ? Also is there any example project to understand in much details.


Solution

  • Considering above use case is spring-statemachine right choice for it ?

    Yes, Spring state machine is a good choice for this use-case.

    Also is there any example project to understand in much details.

    Yes, there are a lot of example projects and in fact, there's one for order shipping/processing: