Hello,
I built RESTfull web application that can read BPMN file from the user and allow him make some change in the uploaded model (for example add groovy script to a script task) , now I want to deploy the modified model to the Camunda engine by using rest API and return the result execution of that model to the web application as response message . In other words, Is it possible to use Camunda engine as a service that I can send a post request with a model to be deployed , executed and get the execution result as a response message.
I 'd appreciate if you kindly give me some suggestions.
@AlioPro can could chain some API calls together and use use the Message Event to ping your web application with the response.
Deploy Process
Start Process using Process Key (use async after on your start event)
1.1. Created Process Instance reaches message event in process and the message event (or service task or send task) calls a web service from your web application with the response data.
I believe there is a new feature in 7.6 where process variables can be returned as part of the start API. Hence conceptually your process model could realise a remote procedure call…
Now the problem is I can’t use the services for start process instance by key or id . Whenever I use these services , I’ll get error 415 (Unsupported media type), and two of the uploaded process do not contain any variables.
I spend all the day thinking about it without any success .
Actually, I don’t know what I missing here. Can you please help me with this problem ?
how does your request look like? 415 (Unsupported media type) means you use a media type, with your request, which is not supported by the server. Make sure that you use application/json as media type and send at least an empty json object ({ }) on starting a process instance. See for more information the REST API documentation.
Thank you very much for your notes. The problem was, I did not add application/json in the request header.
I use Advance REST Client to call services, process instances for models contain script task is created on my Localhost, Now the problem is, I could not deploy models contain service task which implemented by using HTTP-connector.
When I call ( /deployment/create) service , I will get
("ENGINE-09005 Could not parse BPMN process. Errors: * One of the attributes ‘class’, ‘delegateExpression’, ‘type’, or ‘expression’ is mandatory on serviceTask) since I did n’t specify (class or delegateExpression or delegateExpression ) but I used (bpmn2:extensionElements) for http- connector.