Created
May 10, 2022 09:13
-
-
Save berndruecker/281fbbf1cc4b88d493473e235af49c26 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
public class OrderFulfillmentRestController { | |
@Autowired | |
private ProcessEngine camunda; | |
@RequestMapping(path = "/order", method = PUT) | |
public String placeOrder(String orderPayload, HttpServletResponse response) throws Exception { | |
// TODO: Somehow extract data from orderPayload | |
String orderData = "todo"; | |
ProcessInstance pi = camunda.getRuntimeService() // | |
.startProcessInstanceByKey("orderFulfillment", // | |
Variables.putValue("order", orderData)); | |
response.setStatus(HttpServletResponse.SC_ACCEPTED); | |
return "{\"status\":\"pending\"}"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment