Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 2.3 KB

README.md

File metadata and controls

46 lines (35 loc) · 2.3 KB

Decisions as a Service (DaaS)

The business decisions can be modeled with DMN and these can be expose through a cloud function or a microservice. This implementation expose a decision modeled with DMN through Spring Cloud Function and Camunda DMN Engine

Starting the function

❯ ./mvnw spring-boot:run
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.4)

2021-08-31 14:51:07.996  INFO 73769 --- [           main] com.demo.function.FunctionApplication    : Starting FunctionApplication using Java 11.0.11 on hostname.local with PID 73769 (/Users/guest/Dev/uala/dmn-function/target/classes started by guest in /Users/guest/Dev/uala/dmn-function)
...
2021-08-31 14:51:09.356  INFO 73769 --- [           main] o.s.c.f.web.mvc.FunctionHandlerMapping   : FunctionCatalog: org.springframework.cloud.function.context.catalog.BeanFactoryAwareFunctionRegistry@1f15e689
...
2021-08-31 14:51:09.393  INFO 73769 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2021-08-31 14:51:09.401  INFO 73769 --- [           main] com.demo.function.FunctionApplication    : Started FunctionApplication in 6.727 seconds (JVM running for 7.089)

Consuming a decision

❯ curl localhost:8080/voucherToApply -H "Content-Type: text/plain" -d "2021-08-30T20:09:17Z|47541920|PedidosYa*"
❯ PedidosYa_50_off
❯ curl localhost:8080/voucherToApply -H "Content-Type: text/plain" -d "2021-01-20T20:09:17Z|47541920|PedidosYa*"
❯ PedidosYa_30_off

Reference Documentation

For further reference, please consider the following sections: