Skip to content

Commit 60e5196

Browse files
committed
WIP
1 parent 17da0d0 commit 60e5196

File tree

11 files changed

+42482
-680
lines changed

11 files changed

+42482
-680
lines changed

demo/App.jsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import 'camunda-bpmn-js/dist/assets/camunda-cloud-modeler.css';
77

88
import TaskTesting from '../lib';
99

10-
import diagram from './fixtures/diagram.bpmn';
10+
// import diagram from './fixtures/diagram.bpmn';
11+
import diagram from './fixtures/diagram-2.bpmn';
1112
import connectorTemplates from './fixtures/connectorTemplates.json';
1213
import defaultConfig from './fixtures/config';
1314

@@ -26,7 +27,7 @@ function App() {
2627

2728
const [ modeler, setModeler ] = useState(null);
2829

29-
const [ isConnectionConfigured, setIsConnectionConfigured ] = useState(false);
30+
const [ isConnectionConfigured, setIsConnectionConfigured ] = useState(true);
3031

3132
const [ config, setConfig ] = useState(undefined);
3233

@@ -114,6 +115,11 @@ function App() {
114115
.then(response => response.json());
115116
};
116117

118+
const getProcessInstanceSequenceFlows = async (processInstanceKey) => {
119+
return fetch(`/api/getProcessInstanceSequenceFlows/${processInstanceKey}`)
120+
.then(response => response.json());
121+
};
122+
117123
const { current: onConfigChanged } = useRef(debounce(config => setConfig(config), 300));
118124

119125
// eslint-disable-next-line no-undef
@@ -150,6 +156,9 @@ function App() {
150156

151157
return false;
152158
} }
159+
onTaskExecutionUpdated={ (event) => {
160+
console.log('Task testing updated', event);
161+
} }
153162
api={ {
154163
deploy,
155164
startInstance,
@@ -176,12 +185,12 @@ function TestTab(props) {
176185
}
177186

178187
return <TaskTesting { ...props }>
179-
<RPATab />
188+
{/* <RPATab />
180189
<RPALink />
181190
<FooTabDynamic />
182191
<FooTabStatic />
183192
<FooLinkDynamic />
184-
<FooLinkStatic />
193+
<FooLinkStatic /> */}
185194
</TaskTesting>;
186195
}
187196

demo/fixtures/config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ const output = {
139139
'RPA_Result': 'https://foobar.com'
140140
},
141141
'operateUrl': 'https://camunda.com'
142+
},
143+
'AI_Agent': {
144+
'variables': {
145+
'prompt': 'Is there a user called Philipp Fromme?'
146+
}
142147
}
143148
};
144149

demo/fixtures/connectorTemplates.json

Lines changed: 42228 additions & 627 deletions
Large diffs are not rendered by default.

demo/fixtures/diagram-2.bpmn

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0z8bmse" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.44.0-rc.2-dev" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.9.0">
3+
<bpmn:process id="Process_1g2elor" isExecutable="true">
4+
<bpmn:startEvent id="StartEvent_1">
5+
<bpmn:outgoing>Flow_0wdx9je</bpmn:outgoing>
6+
</bpmn:startEvent>
7+
<bpmn:serviceTask id="ListUsers" name="List users" zeebe:modelerTemplate="io.camunda.connectors.HttpJson.v2" zeebe:modelerTemplateVersion="10" zeebe:modelerTemplateIcon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE3LjAzMzUgOC45OTk5N0MxNy4wMzM1IDEzLjQ0NzUgMTMuNDI4MSAxNy4wNTI5IDguOTgwNjUgMTcuMDUyOUM0LjUzMzE2IDE3LjA1MjkgMC45Mjc3NjUgMTMuNDQ3NSAwLjkyNzc2NSA4Ljk5OTk3QzAuOTI3NzY1IDQuNTUyNDggNC41MzMxNiAwLjk0NzA4MyA4Ljk4MDY1IDAuOTQ3MDgzQzEzLjQyODEgMC45NDcwODMgMTcuMDMzNSA0LjU1MjQ4IDE3LjAzMzUgOC45OTk5N1oiIGZpbGw9IiM1MDU1NjIiLz4KPHBhdGggZD0iTTQuOTMxMjYgMTQuMTU3MUw2Ljc4MTA2IDMuNzE0NzFIMTAuMTM3NUMxMS4xOTE3IDMuNzE0NzEgMTEuOTgyNCAzLjk4MzIzIDEyLjUwOTUgNC41MjAyN0MxMy4wNDY1IDUuMDQ3MzYgMTMuMzE1IDUuNzMzNTggMTMuMzE1IDYuNTc4OTJDMTMuMzE1IDcuNDQ0MTQgMTMuMDcxNCA4LjE1NTIyIDEyLjU4NDEgOC43MTIxNUMxMi4xMDY3IDkuMjU5MTMgMTEuNDU1MyA5LjYzNzA1IDEwLjYyOTggOS44NDU5TDEyLjA2MTkgMTQuMTU3MUgxMC4zMzE1TDkuMDMzNjQgMTAuMDI0OUg3LjI0MzUxTDYuNTEyNTQgMTQuMTU3MUg0LjkzMTI2Wk03LjQ5NzExIDguNTkyODFIOS4yNDI0OEM5Ljk5ODMyIDguNTkyODEgMTAuNTkwMSA4LjQyMzc0IDExLjAxNzcgOC4wODU2MUMxMS40NTUzIDcuNzM3NTMgMTEuNjc0MSA3LjI2NTEzIDExLjY3NDEgNi42Njg0MkMxMS42NzQxIDYuMTkxMDYgMTEuNTI0OSA1LjgxODExIDExLjIyNjUgNS41NDk1OUMxMC45MjgyIDUuMjcxMTMgMTAuNDU1OCA1LjEzMTkgOS44MDkzNiA1LjEzMTlIOC4xMDg3NEw3LjQ5NzExIDguNTkyODFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K">
8+
<bpmn:documentation>Lists all available users. More contact details (such as e-mail addresses) can be loaded up by looking up the individual user by ID.</bpmn:documentation>
9+
<bpmn:extensionElements>
10+
<zeebe:taskDefinition type="io.camunda:http-json:1" retries="3" />
11+
<zeebe:ioMapping>
12+
<zeebe:input source="noAuth" target="authentication.type" />
13+
<zeebe:input source="GET" target="method" />
14+
<zeebe:input source="https://jsonplaceholder.typicode.com/users" target="url" />
15+
<zeebe:input source="=false" target="storeResponse" />
16+
<zeebe:input source="20" target="connectionTimeoutInSeconds" />
17+
<zeebe:input source="20" target="readTimeoutInSeconds" />
18+
<zeebe:input source="=false" target="ignoreNullValues" />
19+
</zeebe:ioMapping>
20+
<zeebe:taskHeaders>
21+
<zeebe:header key="resultExpression" value="={&#10; toolCallResult: for user in response.body return {&#10; id: user.id,&#10; name: user.name,&#10; username: user.username&#10; }&#10;}" />
22+
<zeebe:header key="retryBackoff" value="PT0S" />
23+
</zeebe:taskHeaders>
24+
</bpmn:extensionElements>
25+
<bpmn:incoming>Flow_0wdx9je</bpmn:incoming>
26+
<bpmn:outgoing>Flow_1w8gjup</bpmn:outgoing>
27+
</bpmn:serviceTask>
28+
<bpmn:serviceTask id="Search_Recipe" name="Search recipe" zeebe:modelerTemplate="io.camunda.connectors.HttpJson.v2" zeebe:modelerTemplateVersion="10" zeebe:modelerTemplateIcon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE3LjAzMzUgOC45OTk5N0MxNy4wMzM1IDEzLjQ0NzUgMTMuNDI4MSAxNy4wNTI5IDguOTgwNjUgMTcuMDUyOUM0LjUzMzE2IDE3LjA1MjkgMC45Mjc3NjUgMTMuNDQ3NSAwLjkyNzc2NSA4Ljk5OTk3QzAuOTI3NzY1IDQuNTUyNDggNC41MzMxNiAwLjk0NzA4MyA4Ljk4MDY1IDAuOTQ3MDgzQzEzLjQyODEgMC45NDcwODMgMTcuMDMzNSA0LjU1MjQ4IDE3LjAzMzUgOC45OTk5N1oiIGZpbGw9IiM1MDU1NjIiLz4KPHBhdGggZD0iTTQuOTMxMjYgMTQuMTU3MUw2Ljc4MTA2IDMuNzE0NzFIMTAuMTM3NUMxMS4xOTE3IDMuNzE0NzEgMTEuOTgyNCAzLjk4MzIzIDEyLjUwOTUgNC41MjAyN0MxMy4wNDY1IDUuMDQ3MzYgMTMuMzE1IDUuNzMzNTggMTMuMzE1IDYuNTc4OTJDMTMuMzE1IDcuNDQ0MTQgMTMuMDcxNCA4LjE1NTIyIDEyLjU4NDEgOC43MTIxNUMxMi4xMDY3IDkuMjU5MTMgMTEuNDU1MyA5LjYzNzA1IDEwLjYyOTggOS44NDU5TDEyLjA2MTkgMTQuMTU3MUgxMC4zMzE1TDkuMDMzNjQgMTAuMDI0OUg3LjI0MzUxTDYuNTEyNTQgMTQuMTU3MUg0LjkzMTI2Wk03LjQ5NzExIDguNTkyODFIOS4yNDI0OEM5Ljk5ODMyIDguNTkyODEgMTAuNTkwMSA4LjQyMzc0IDExLjAxNzcgOC4wODU2MUMxMS40NTUzIDcuNzM3NTMgMTEuNjc0MSA3LjI2NTEzIDExLjY3NDEgNi42Njg0MkMxMS42NzQxIDYuMTkxMDYgMTEuNTI0OSA1LjgxODExIDExLjIyNjUgNS41NDk1OUMxMC45MjgyIDUuMjcxMTMgMTAuNDU1OCA1LjEzMTkgOS44MDkzNiA1LjEzMTlIOC4xMDg3NEw3LjQ5NzExIDguNTkyODFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K">
29+
<bpmn:documentation>Searches a recipe given a search query</bpmn:documentation>
30+
<bpmn:extensionElements>
31+
<zeebe:taskDefinition type="io.camunda:http-json:1" retries="3" />
32+
<zeebe:ioMapping>
33+
<zeebe:input source="noAuth" target="authentication.type" />
34+
<zeebe:input source="GET" target="method" />
35+
<zeebe:input source="https://dummyjson.com/recipes/search" target="url" />
36+
<zeebe:input source="={&#10; q: fromAi(toolCall.searchQuery, &#34;The query describing which recipe to search (e.g. a specific dish or the cuisine).&#34;)&#10;}" target="queryParameters" />
37+
<zeebe:input source="=false" target="storeResponse" />
38+
<zeebe:input source="20" target="connectionTimeoutInSeconds" />
39+
<zeebe:input source="20" target="readTimeoutInSeconds" />
40+
<zeebe:input source="=false" target="ignoreNullValues" />
41+
</zeebe:ioMapping>
42+
<zeebe:taskHeaders>
43+
<zeebe:header key="resultExpression" value="={&#10; toolCallResult: if (count(response.body.recipes) &#62; 0) then response.body.recipes else &#34;No result found.&#34;&#10;}" />
44+
<zeebe:header key="retryBackoff" value="PT0S" />
45+
</zeebe:taskHeaders>
46+
</bpmn:extensionElements>
47+
<bpmn:incoming>Flow_1w8gjup</bpmn:incoming>
48+
<bpmn:outgoing>Flow_1xvtx48</bpmn:outgoing>
49+
</bpmn:serviceTask>
50+
<bpmn:serviceTask id="Jokes_API" name="Jokes API" zeebe:modelerTemplate="io.camunda.connectors.HttpJson.v2" zeebe:modelerTemplateVersion="10" zeebe:modelerTemplateIcon="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE3LjAzMzUgOC45OTk5N0MxNy4wMzM1IDEzLjQ0NzUgMTMuNDI4MSAxNy4wNTI5IDguOTgwNjUgMTcuMDUyOUM0LjUzMzE2IDE3LjA1MjkgMC45Mjc3NjUgMTMuNDQ3NSAwLjkyNzc2NSA4Ljk5OTk3QzAuOTI3NzY1IDQuNTUyNDggNC41MzMxNiAwLjk0NzA4MyA4Ljk4MDY1IDAuOTQ3MDgzQzEzLjQyODEgMC45NDcwODMgMTcuMDMzNSA0LjU1MjQ4IDE3LjAzMzUgOC45OTk5N1oiIGZpbGw9IiM1MDU1NjIiLz4KPHBhdGggZD0iTTQuOTMxMjYgMTQuMTU3MUw2Ljc4MTA2IDMuNzE0NzFIMTAuMTM3NUMxMS4xOTE3IDMuNzE0NzEgMTEuOTgyNCAzLjk4MzIzIDEyLjUwOTUgNC41MjAyN0MxMy4wNDY1IDUuMDQ3MzYgMTMuMzE1IDUuNzMzNTggMTMuMzE1IDYuNTc4OTJDMTMuMzE1IDcuNDQ0MTQgMTMuMDcxNCA4LjE1NTIyIDEyLjU4NDEgOC43MTIxNUMxMi4xMDY3IDkuMjU5MTMgMTEuNDU1MyA5LjYzNzA1IDEwLjYyOTggOS44NDU5TDEyLjA2MTkgMTQuMTU3MUgxMC4zMzE1TDkuMDMzNjQgMTAuMDI0OUg3LjI0MzUxTDYuNTEyNTQgMTQuMTU3MUg0LjkzMTI2Wk03LjQ5NzExIDguNTkyODFIOS4yNDI0OEM5Ljk5ODMyIDguNTkyODEgMTAuNTkwMSA4LjQyMzc0IDExLjAxNzcgOC4wODU2MUMxMS40NTUzIDcuNzM3NTMgMTEuNjc0MSA3LjI2NTEzIDExLjY3NDEgNi42Njg0MkMxMS42NzQxIDYuMTkxMDYgMTEuNTI0OSA1LjgxODExIDExLjIyNjUgNS41NDk1OUMxMC45MjgyIDUuMjcxMTMgMTAuNDU1OCA1LjEzMTkgOS44MDkzNiA1LjEzMTlIOC4xMDg3NEw3LjQ5NzExIDguNTkyODFaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K">
51+
<bpmn:documentation>Fetches a random joke from a Jokes REST API</bpmn:documentation>
52+
<bpmn:extensionElements>
53+
<zeebe:taskDefinition type="io.camunda:http-json:1" retries="3" />
54+
<zeebe:ioMapping>
55+
<zeebe:input source="noAuth" target="authentication.type" />
56+
<zeebe:input source="GET" target="method" />
57+
<zeebe:input source="https://v2.jokeapi.dev/joke/Any?format=txt&#38;safe-mode" target="url" />
58+
<zeebe:input source="=false" target="storeResponse" />
59+
<zeebe:input source="=20" target="connectionTimeoutInSeconds" />
60+
<zeebe:input source="=20" target="readTimeoutInSeconds" />
61+
<zeebe:input source="=false" target="ignoreNullValues" />
62+
</zeebe:ioMapping>
63+
<zeebe:taskHeaders>
64+
<zeebe:header key="resultExpression" value="={&#10; toolCallResult: response.body&#10;}" />
65+
<zeebe:header key="retryBackoff" value="PT0S" />
66+
</zeebe:taskHeaders>
67+
</bpmn:extensionElements>
68+
<bpmn:incoming>Flow_1xvtx48</bpmn:incoming>
69+
<bpmn:outgoing>Flow_0pm8lq9</bpmn:outgoing>
70+
</bpmn:serviceTask>
71+
<bpmn:sequenceFlow id="Flow_0wdx9je" sourceRef="StartEvent_1" targetRef="ListUsers" />
72+
<bpmn:sequenceFlow id="Flow_1w8gjup" sourceRef="ListUsers" targetRef="Search_Recipe" />
73+
<bpmn:sequenceFlow id="Flow_1xvtx48" sourceRef="Search_Recipe" targetRef="Jokes_API" />
74+
<bpmn:endEvent id="Event_0qjuj9v">
75+
<bpmn:incoming>Flow_0pm8lq9</bpmn:incoming>
76+
</bpmn:endEvent>
77+
<bpmn:sequenceFlow id="Flow_0pm8lq9" sourceRef="Jokes_API" targetRef="Event_0qjuj9v" />
78+
</bpmn:process>
79+
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
80+
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1g2elor">
81+
<bpmndi:BPMNShape id="StartEvent_1_di" bpmnElement="StartEvent_1">
82+
<dc:Bounds x="182" y="102" width="36" height="36" />
83+
</bpmndi:BPMNShape>
84+
<bpmndi:BPMNShape id="Activity_0kkpyxf_di" bpmnElement="ListUsers">
85+
<dc:Bounds x="270" y="80" width="100" height="80" />
86+
</bpmndi:BPMNShape>
87+
<bpmndi:BPMNShape id="Activity_0d8luif_di" bpmnElement="Search_Recipe">
88+
<dc:Bounds x="410" y="80" width="100" height="80" />
89+
<bpmndi:BPMNLabel />
90+
</bpmndi:BPMNShape>
91+
<bpmndi:BPMNShape id="Activity_1l8tp85_di" bpmnElement="Jokes_API">
92+
<dc:Bounds x="550" y="80" width="100" height="80" />
93+
</bpmndi:BPMNShape>
94+
<bpmndi:BPMNShape id="Event_0qjuj9v_di" bpmnElement="Event_0qjuj9v">
95+
<dc:Bounds x="692" y="102" width="36" height="36" />
96+
</bpmndi:BPMNShape>
97+
<bpmndi:BPMNEdge id="Flow_0wdx9je_di" bpmnElement="Flow_0wdx9je">
98+
<di:waypoint x="218" y="120" />
99+
<di:waypoint x="270" y="120" />
100+
</bpmndi:BPMNEdge>
101+
<bpmndi:BPMNEdge id="Flow_1w8gjup_di" bpmnElement="Flow_1w8gjup">
102+
<di:waypoint x="370" y="120" />
103+
<di:waypoint x="410" y="120" />
104+
</bpmndi:BPMNEdge>
105+
<bpmndi:BPMNEdge id="Flow_1xvtx48_di" bpmnElement="Flow_1xvtx48">
106+
<di:waypoint x="510" y="120" />
107+
<di:waypoint x="550" y="120" />
108+
</bpmndi:BPMNEdge>
109+
<bpmndi:BPMNEdge id="Flow_0pm8lq9_di" bpmnElement="Flow_0pm8lq9">
110+
<di:waypoint x="650" y="120" />
111+
<di:waypoint x="692" y="120" />
112+
</bpmndi:BPMNEdge>
113+
</bpmndi:BPMNPlane>
114+
</bpmndi:BPMNDiagram>
115+
</bpmn:definitions>

0 commit comments

Comments
 (0)