Skip to content

Latest commit

 

History

History
82 lines (65 loc) · 2.91 KB

File metadata and controls

82 lines (65 loc) · 2.91 KB

Camunda Platform Runtime: Quarkus Engine Extension Spin Example

This example uses Quarkus, the Supersonic Subatomic Java Framework, in combination with the extension camunda-bpm-quarkus-engine.

If you want to learn more about Quarkus, please visit: https://quarkus.io/.

The example demonstrates how you can use the Camunda Platform Runtime Engine in combination with Quarkus to spawn a node that:

To store order items, perform the following REST API request:

curl -X POST 'http://localhost:8080/store-order-items' \
  -H 'Content-Type: application/json' \
  --data-raw '
  [
    {
      "name": "Skin Care",
      "price": 4.56
    },
    {
      "name": "Watch",
      "price": 60.55
    },
    {
      "name": "Cookies",
      "price": 1.99
    },
    {
      "name": "Pasta",
      "price": 0.95
    }
  ]'

Observe the console and watch out for the following log output:

2021-08-25 15:04:16,772 INFO  [org.cam.bpm.qua.exa.ser.StoreOrderItemService] (executor-thread-0) Hurray, order item Skin Care with price 4,56 stored!
2021-08-25 15:04:16,782 INFO  [org.cam.bpm.qua.exa.ser.StoreOrderItemService] (executor-thread-0) Hurray, order item Watch with price 60,55 stored!
2021-08-25 15:04:16,788 INFO  [org.cam.bpm.qua.exa.ser.StoreOrderItemService] (executor-thread-0) Hurray, order item Cookies with price 1,99 stored!
2021-08-25 15:04:16,793 INFO  [org.cam.bpm.qua.exa.ser.StoreOrderItemService] (executor-thread-0) Hurray, order item Pasta with price 0,95 stored!

Requirements

  • Java 17+
  • Maven 3.8.1+

Running the application in dev mode

You can run your application in dev mode that enables live coding using:

mvn clean compile quarkus:dev

NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.

Packaging and running the application

The application can be packaged using:

mvn clean package

It produces the quarkus-run.jar file in the target/quarkus-app/ directory. Be aware that it’s not an über-jar as the dependencies are copied into the target/quarkus-app/lib/ directory.

If you want to build an über-jar, execute the following command:

mvn clean package -Dquarkus.package.type=uber-jar

The application is now runnable using java -jar target/camunda-bpm-quarkus-example-spin-plugin-1.0.0-SNAPSHOT-runner.jar.