Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alfonso-presa/restflow-spring-web-sample
Sample web project for https://github.com/alfonso-presa/restflow. It shows how to use RestFlow along with Spring Web MVC and JPA to create a RESTful stateless resource with it's associated workflow.
https://github.com/alfonso-presa/restflow-spring-web-sample
Last synced: 9 days ago
JSON representation
Sample web project for https://github.com/alfonso-presa/restflow. It shows how to use RestFlow along with Spring Web MVC and JPA to create a RESTful stateless resource with it's associated workflow.
- Host: GitHub
- URL: https://github.com/alfonso-presa/restflow-spring-web-sample
- Owner: alfonso-presa
- Created: 2015-08-20T17:47:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-10T22:46:07.000Z (almost 9 years ago)
- Last Synced: 2024-11-13T18:12:09.210Z (about 2 months ago)
- Language: Java
- Homepage:
- Size: 52.7 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Sample web project for [RestFlow](https://github.com/alfonso-presa/restflow) project.
It shows how to use RestFlow along with Spring Web MVC and JPA to create a RESTful
stateless resource with it's associated workflow.## Running
Clone the repo and run
```
gradlew bootRun
```Ofcourse you need gradle in place to do this :-).
## Sample requests
To create a new Order run
```
curl --data "products=1&products=2&customer=Alfonso" http://localhost:8080/orders
```Get all the orders with
```
curl http://localhost:8080/orders
```Get a single order
```
curl http://localhost:8080/orders/1
```Pay that order by running
```
curl --data "recipe=I_PAYED" http://localhost:8080/orders/1/actions/pay
curl http://localhost:8080/orders/1
```To mark the order as delivered run
```
curl --data "tracking=UPS-1321341" http://localhost:8080/orders/1/actions/send
```You will notice that if you run the actions in a different order or if you don't provide
the correct parameters you will get errors. That's controlled by RestFlow itself painlessly.