The goal of this project is to show how to call a Rest Service from jBPM process.
This example provides two options:
- Default REST WorkItemHandler
- A custom WIH to perform the Rest call through the popular Camel Framework
Learn more about the project details in the related module documents:
This mock server expose a simple order fulfilment API:
podman run --rm -it -v ./rest-mock-server:/root/apis:Z -p 4010:4010 stoplight/prism mock -h 0.0.0.0 /root/apis/order-api.yaml
cd rest-wih-service
./launch.sh clean install
The following command trigger the rest process, replace rest_call
with camel_rest_call
to trigger the process with the Camel WIH.
curl -u controllerUser:controllerUser1234\; --request POST \
--url http://localhost:8090/rest/server/containers/rest-wih-kjar/processes/rest_call/instances \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"order" : {"com.redhat.demo.Order" : {"item" : "phone","quantity" : 4,"price" : 120.0}}}'