-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(camunda8): implement deleteResource over REST
fixes #251
- Loading branch information
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { C8RestClient } from '../../../c8/lib/C8RestClient' | ||
|
||
const c8 = new C8RestClient() | ||
|
||
test('It can delete a resource', async () => { | ||
const res = await c8.deployResourcesFromFiles([ | ||
'./src/__tests__/testdata/Delete-Resource-Rest.bpmn', | ||
]) | ||
const key = res.processes[0].processDefinitionKey | ||
const id = res.processes[0].bpmnProcessId | ||
const wfi = await c8.createProcessInstance({ | ||
bpmnProcessId: id, | ||
variables: {}, | ||
}) | ||
expect(wfi.processKey).toBe(key) | ||
await c8.deleteResource({ resourceKey: key }) | ||
await expect( | ||
c8.createProcessInstance({ bpmnProcessId: id, variables: {} }) | ||
).rejects.toThrow() | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?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:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_09sn3dz" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.27.0" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.5.0"> | ||
<bpmn:process id="delete-me-rest" name="Deletable Resource" isExecutable="true"> | ||
<bpmn:startEvent id="StartEvent_1" name="Start"> | ||
<bpmn:outgoing>Flow_0z9jd9c</bpmn:outgoing> | ||
</bpmn:startEvent> | ||
<bpmn:endEvent id="Event_1jyt422" name="End"> | ||
<bpmn:incoming>Flow_0z9jd9c</bpmn:incoming> | ||
</bpmn:endEvent> | ||
<bpmn:sequenceFlow id="Flow_0z9jd9c" sourceRef="StartEvent_1" targetRef="Event_1jyt422" /> | ||
</bpmn:process> | ||
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> | ||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="delete-me-rest"> | ||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> | ||
<dc:Bounds x="179" y="79" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="185" y="122" width="24" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_1jyt422_di" bpmnElement="Event_1jyt422"> | ||
<dc:Bounds x="272" y="79" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="280" y="122" width="20" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="Flow_0z9jd9c_di" bpmnElement="Flow_0z9jd9c"> | ||
<di:waypoint x="215" y="97" /> | ||
<di:waypoint x="272" y="97" /> | ||
</bpmndi:BPMNEdge> | ||
</bpmndi:BPMNPlane> | ||
</bpmndi:BPMNDiagram> | ||
</bpmn:definitions> |
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
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