Skip to content

dmarrazzo/rhpam-rest-wih-usage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

simple process calling a REST service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published