Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.33 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.33 KB

REST Call from jBPM / RHPAM

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:

Run the Rest Mock server

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

Run the SpringBoot service

cd rest-wih-service
./launch.sh clean install

Test the processes

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}}}'