49. Order Shipping

Order Shipping is an example how state machine concepts can be used with a process of building a simple order processing system.

Below you can see a statechart driving this order shipping sample.

sm ordershipping 1

What is happening a above statechart:

Let’s get into actual demo. Run the boot based sample application:

# java -jar spring-statemachine-samples-ordershipping-2.1.0.M1.jar

In a browser you see something shown above. You can start by choosing customer and order and create a machine.

sm ordershipping 2

Machine for particular order is now created and you can start to play with placing an order and sending a payment. Other settings like makeProdPlan, produce and payment allows you to control how machine works.

sm ordershipping 3

Finally you can see what machine does by refreshing a page.

sm ordershipping 4