-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added another example about converter extension (#1037)
* added another example about converter extension * example uses a stable version * disabled non-working test * moved to java 17
- Loading branch information
1 parent
3a17ec5
commit 84ed627
Showing
8 changed files
with
149 additions
and
4 deletions.
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
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
33 changes: 33 additions & 0 deletions
33
...main/java/org/camunda/community/migration/example/extendedConverter/TaskTopicVisitor.java
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,33 @@ | ||
package org.camunda.community.migration.example.extendedConverter; | ||
|
||
import org.camunda.community.migration.converter.BpmnDiagramCheckResult.Severity; | ||
import org.camunda.community.migration.converter.DomElementVisitorContext; | ||
import org.camunda.community.migration.converter.convertible.ServiceTaskConvertible; | ||
import org.camunda.community.migration.converter.message.ComposedMessage; | ||
import org.camunda.community.migration.converter.message.Message; | ||
import org.camunda.community.migration.converter.visitor.AbstractSupportedAttributeVisitor; | ||
|
||
public class TaskTopicVisitor extends AbstractSupportedAttributeVisitor { | ||
|
||
@Override | ||
public String attributeLocalName() { | ||
return "topic"; | ||
} | ||
|
||
@Override | ||
protected Message visitSupportedAttribute(DomElementVisitorContext context, String attribute) { | ||
context.addConversion( | ||
ServiceTaskConvertible.class, | ||
serviceTaskConversion -> serviceTaskConversion.addZeebeTaskHeader(attributeLocalName(), attribute)); | ||
context.addConversion( | ||
ServiceTaskConvertible.class, | ||
serviceTaskConversion -> serviceTaskConversion | ||
.getZeebeTaskDefinition() | ||
.setType("GenericWorker")); | ||
ComposedMessage composedMessage = new ComposedMessage(); | ||
composedMessage.setMessage("Tasktopic has been transformed: " + attribute); | ||
composedMessage.setSeverity(Severity.INFO); | ||
composedMessage.setLink("Link"); | ||
return composedMessage; | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...ces/META-INF/services/org.camunda.community.migration.converter.visitor.DomElementVisitor
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
org.camunda.community.migration.example.extendedConverter.CustomDomElementVisitor | ||
org.camunda.community.migration.example.extendedConverter.CustomDomElementVisitor | ||
org.camunda.community.migration.example.extendedConverter.TaskTopicVisitor |
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
45 changes: 45 additions & 0 deletions
45
example/extended-converter/src/test/resources/ExternalTaskWorker_Example.bpmn
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,45 @@ | ||
<?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:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0lg2s2j" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.28.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.22.0"> | ||
<bpmn:process id="Process_1j6ouum" isExecutable="true"> | ||
<bpmn:startEvent id="StartEvent_1" name="Process started"> | ||
<bpmn:outgoing>Flow_0zz19uu</bpmn:outgoing> | ||
</bpmn:startEvent> | ||
<bpmn:sequenceFlow id="Flow_0zz19uu" sourceRef="StartEvent_1" targetRef="Activity_1qqj67q" /> | ||
<bpmn:endEvent id="Event_04ydt36" name="Process ended"> | ||
<bpmn:incoming>Flow_06q11dh</bpmn:incoming> | ||
</bpmn:endEvent> | ||
<bpmn:sequenceFlow id="Flow_06q11dh" sourceRef="Activity_1qqj67q" targetRef="Event_04ydt36" /> | ||
<bpmn:serviceTask id="Activity_1qqj67q" name="Call test topic" camunda:type="external" camunda:topic="TestTopic"> | ||
<bpmn:incoming>Flow_0zz19uu</bpmn:incoming> | ||
<bpmn:outgoing>Flow_06q11dh</bpmn:outgoing> | ||
</bpmn:serviceTask> | ||
</bpmn:process> | ||
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> | ||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1j6ouum"> | ||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> | ||
<dc:Bounds x="179" y="99" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="159" y="142" width="77" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_04ydt36_di" bpmnElement="Event_04ydt36"> | ||
<dc:Bounds x="432" y="99" width="36" height="36" /> | ||
<bpmndi:BPMNLabel> | ||
<dc:Bounds x="413" y="142" width="74" height="14" /> | ||
</bpmndi:BPMNLabel> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Activity_0smb4x6_di" bpmnElement="Activity_1qqj67q"> | ||
<dc:Bounds x="270" y="77" width="100" height="80" /> | ||
<bpmndi:BPMNLabel /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="Flow_0zz19uu_di" bpmnElement="Flow_0zz19uu"> | ||
<di:waypoint x="215" y="117" /> | ||
<di:waypoint x="270" y="117" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_06q11dh_di" bpmnElement="Flow_06q11dh"> | ||
<di:waypoint x="370" y="117" /> | ||
<di:waypoint x="432" y="117" /> | ||
</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