Create process definition via REST API

Hi,

Is there any endpoint I can use to create Process definition using REST API. I would like 100% development of workflow using REST.

Hey @prabhushan,

Not sure what you mean, but you can deploy a BPMN XML file over REST and that would create a process definition.

Cheers,
Filip

Thank you @filiphr. I am trying to integrate flowable in my application using 100% REST i.e no modeler UI, admin UI, IDM UI & tasks UI.

I am trying to create my own UI but use flowable engine using REST. I am facing problem to create Process definition.

  1. Which endpoint using REST can we send the BPMN XML. Could you please let me know.

  2. How to create an APP using REST API. I see only the following for APP definition. Everything is GET not POST

I would advise that you read a bit about Deployments.

Definitions are just metadata, they are created via deployments.

Building your own UI for creating BPMN XML is not that easy as you think.

Cheers,
Filip

HI

In Java

String processKey = “key_from_BPNM_XML”;

	ProcessInstance processInstance = null;
	try {
		processInstance = initiateProcess(processKey);
	} catch (Exception e) {
		e.printStackTrace();
	}

just create a rest api and call this method from UI.

Please let me know if the above is not relative

cheers

Chakra

1 Like

Thank you @filiphr / @chakra.

I found the information useful. I used BPMN.io to create a BPMN.xml file. When I upload the BPMN xml file in the processmodel using flowable UI, I could see the model generated - which is good. But I have the following concern:

I want to link a form to this BPMN.xml. I used the formKey attribute in the xml, but I see the formreference is still blank.

BPMN.xml below

<?xml version="1.0" encoding="UTF-8"?>

<bpmn:definitions xmlns:bpmn=“http://www.omg.org/spec/BPMN/20100524/MODEL
xmlns:bpmndi=“http://www.omg.org/spec/BPMN/20100524/DI
xmlns:dc=“http://www.omg.org/spec/DD/20100524/DC
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xmlns:di=“http://www.omg.org/spec/DD/20100524/DI
xmlns:camunda=“http://flowable.org/bpmn” id=“Definitions_1” targetNamespace=“http://bpmn.io/schema/bpmn”>
<bpmn:process id=“Process_1” isExecutable=“false”>
<bpmn:startEvent id=“StartEvent_1”>
bpmn:outgoingSequenceFlow_0waszxe</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id=“SequenceFlow_0waszxe” sourceRef=“StartEvent_1” targetRef=“Task_1rpqotj” />
<bpmn:userTask id=“Task_1rpqotj” camunda:formKey=“someform”>
bpmn:incomingSequenceFlow_0waszxe</bpmn:incoming>
bpmn:outgoingSequenceFlow_0g6biir</bpmn:outgoing>
</bpmn:userTask>
<bpmn:endEvent id=“EndEvent_1pyo63z”>
bpmn:incomingSequenceFlow_0g6biir</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id=“SequenceFlow_0g6biir” sourceRef=“Task_1rpqotj” targetRef=“EndEvent_1pyo63z” />
</bpmn:process>
<bpmndi:BPMNDiagram id=“BPMNDiagram_1”>
<bpmndi:BPMNPlane id=“BPMNPlane_1” bpmnElement=“Process_1”>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement=“StartEvent_1”>
<dc:Bounds x=“341” y=“23” width=“36” height=“36” />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id=“SequenceFlow_0waszxe_di” bpmnElement=“SequenceFlow_0waszxe”>
<di:waypoint x=“377” y=“41” />
<di:waypoint x=“427” y=“41” />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id=“UserTask_1rwgmud_di” bpmnElement=“Task_1rpqotj”>
<dc:Bounds x=“427” y=“1” width=“100” height=“80” />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id=“EndEvent_1pyo63z_di” bpmnElement=“EndEvent_1pyo63z”>
<dc:Bounds x=“577” y=“23” width=“36” height=“36” />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id=“SequenceFlow_0g6biir_di” bpmnElement=“SequenceFlow_0g6biir”>
<di:waypoint x=“527” y=“41” />
<di:waypoint x=“577” y=“41” />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

Please note: I changed the namespace for Camunda

The formReference will only be filled if it’s set from the modeler, the formKey is a different attribute.