Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save berndruecker/281fbbf1cc4b88d493473e235af49c26 to your computer and use it in GitHub Desktop.
Save berndruecker/281fbbf1cc4b88d493473e235af49c26 to your computer and use it in GitHub Desktop.
@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