|
1 | 1 | export const template = {
|
2 |
| - '$schema': 'https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json', |
3 |
| - 'name': 'AdHoc Template', |
4 |
| - 'id': 'io.camunda.examples.AdHoc.InvalidElementType', |
5 |
| - 'version': 1, |
6 |
| - 'appliesTo': [ 'bpmn:Activity' ], |
7 |
| - 'elementType': { 'value': 'bpmn:' }, |
8 |
| - 'properties': [ |
9 |
| - { |
10 |
| - 'type': 'Hidden', |
11 |
| - 'binding': { 'type': 'zeebe:taskDefinition', 'property': 'type' }, |
12 |
| - 'value': 'io.camunda.agenticai:aiagent-job-worker:1' |
13 |
| - }, |
14 |
| - { |
15 |
| - 'type': 'Hidden', |
16 |
| - 'binding': { 'type': 'zeebe:adHoc', 'property': 'outputCollection' }, |
17 |
| - 'value': 'toolCallResults' |
18 |
| - }, |
19 |
| - { |
20 |
| - 'type': 'String', |
21 |
| - 'binding': { 'type': 'zeebe:adHoc', 'property': 'outputElement' }, |
22 |
| - 'feel': 'required', |
23 |
| - 'value': '={ id: toolCall._meta.id, name: toolCall._meta.name, content: toolCallResult }' |
24 |
| - } |
25 |
| - ] |
26 |
| -}; |
27 |
| - |
28 |
| -export const errors = [ |
| 2 | + '$schema': 'https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json', |
| 3 | + 'name': 'AdHoc Template', |
| 4 | + 'id': 'io.camunda.examples.AdHoc.InvalidElementType', |
| 5 | + 'version': 1, |
| 6 | + 'appliesTo': [ 'bpmn:Activity' ], |
| 7 | + 'elementType': { 'value': 'bpmn:' }, |
| 8 | + 'properties': [ |
29 | 9 | {
|
30 |
| - keyword: "errorMessage", |
31 |
| - dataPath: "/elementType/value", |
32 |
| - schemaPath: "#/allOf/0/properties/elementType/properties/value/errorMessage", |
33 |
| - params: { |
34 |
| - errors: [ |
35 |
| - { |
36 |
| - keyword: "pattern", |
37 |
| - dataPath: "/elementType/value", |
38 |
| - schemaPath: "#/allOf/0/properties/elementType/properties/value/pattern", |
39 |
| - params: { |
40 |
| - pattern: "^[\\w\\d]+:[\\w\\d]+$" |
41 |
| - }, |
42 |
| - message: "should match pattern \"^[\\w\\d]+:[\\w\\d]+$\"", |
43 |
| - emUsed: true |
44 |
| - } |
45 |
| - ] |
46 |
| - }, |
47 |
| - message: "invalid item for \"elementType\", should contain namespaced property, example: \"bpmn:Task\"" |
| 10 | + 'type': 'Hidden', |
| 11 | + 'binding': { 'type': 'zeebe:taskDefinition', 'property': 'type' }, |
| 12 | + 'value': 'io.camunda.agenticai:aiagent-job-worker:1' |
48 | 13 | },
|
49 | 14 | {
|
50 |
| - keyword: "const", |
51 |
| - dataPath: "/elementType/value", |
52 |
| - schemaPath: "#/allOf/1/allOf/9/then/anyOf/0/properties/elementType/properties/value/const", |
53 |
| - params: { |
54 |
| - allowedValue: "bpmn:AdHocSubProcess" |
55 |
| - }, |
56 |
| - message: "should be equal to constant" |
| 15 | + 'type': 'Hidden', |
| 16 | + 'binding': { 'type': 'zeebe:adHoc', 'property': 'outputCollection' }, |
| 17 | + 'value': 'toolCallResults' |
57 | 18 | },
|
58 | 19 | {
|
59 |
| - keyword: "const", |
60 |
| - dataPath: "/appliesTo", |
61 |
| - schemaPath: "#/allOf/1/allOf/9/then/anyOf/1/properties/appliesTo/const", |
62 |
| - params: { |
63 |
| - allowedValue: [ |
64 |
| - "bpmn:AdHocSubProcess" |
65 |
| - ] |
66 |
| - }, |
67 |
| - message: "should be equal to constant" |
| 20 | + 'type': 'String', |
| 21 | + 'binding': { 'type': 'zeebe:adHoc', 'property': 'outputElement' }, |
| 22 | + 'feel': 'required', |
| 23 | + 'value': '={ id: toolCall._meta.id, name: toolCall._meta.name, content: toolCallResult }' |
| 24 | + } |
| 25 | + ] |
| 26 | +}; |
| 27 | + |
| 28 | +export const errors = [ |
| 29 | + { |
| 30 | + keyword: 'errorMessage', |
| 31 | + dataPath: '/elementType/value', |
| 32 | + schemaPath: '#/allOf/0/properties/elementType/properties/value/errorMessage', |
| 33 | + params: { |
| 34 | + errors: [ |
| 35 | + { |
| 36 | + keyword: 'pattern', |
| 37 | + dataPath: '/elementType/value', |
| 38 | + schemaPath: '#/allOf/0/properties/elementType/properties/value/pattern', |
| 39 | + params: { |
| 40 | + pattern: '^[\\w\\d]+:[\\w\\d]+$' |
| 41 | + }, |
| 42 | + message: 'should match pattern "^[\\w\\d]+:[\\w\\d]+$"', |
| 43 | + emUsed: true |
| 44 | + } |
| 45 | + ] |
68 | 46 | },
|
69 |
| - { |
70 |
| - keyword: "anyOf", |
71 |
| - dataPath: "", |
72 |
| - schemaPath: "#/allOf/1/allOf/9/then/anyOf", |
73 |
| - params: {}, |
74 |
| - message: "should match some schema in anyOf" |
| 47 | + message: 'invalid item for "elementType", should contain namespaced property, example: "bpmn:Task"' |
| 48 | + }, |
| 49 | + { |
| 50 | + keyword: 'const', |
| 51 | + dataPath: '/elementType/value', |
| 52 | + schemaPath: '#/allOf/1/allOf/9/then/anyOf/0/properties/elementType/properties/value/const', |
| 53 | + params: { |
| 54 | + allowedValue: 'bpmn:AdHocSubProcess' |
75 | 55 | },
|
76 |
| - { |
77 |
| - keyword: "if", |
78 |
| - dataPath: "", |
79 |
| - schemaPath: "#/allOf/1/allOf/9/if", |
80 |
| - params: { |
81 |
| - failingKeyword: "then" |
82 |
| - }, |
83 |
| - message: "should match \"then\" schema" |
| 56 | + message: 'should be equal to constant' |
| 57 | + }, |
| 58 | + { |
| 59 | + keyword: 'const', |
| 60 | + dataPath: '/appliesTo', |
| 61 | + schemaPath: '#/allOf/1/allOf/9/then/anyOf/1/properties/appliesTo/const', |
| 62 | + params: { |
| 63 | + allowedValue: [ |
| 64 | + 'bpmn:AdHocSubProcess' |
| 65 | + ] |
84 | 66 | },
|
85 |
| - { |
86 |
| - keyword: "type", |
87 |
| - dataPath: "", |
88 |
| - schemaPath: "#/oneOf/1/type", |
89 |
| - params: { |
90 |
| - type: "array" |
91 |
| - }, |
92 |
| - message: "should be array" |
| 67 | + message: 'should be equal to constant' |
| 68 | + }, |
| 69 | + { |
| 70 | + keyword: 'anyOf', |
| 71 | + dataPath: '', |
| 72 | + schemaPath: '#/allOf/1/allOf/9/then/anyOf', |
| 73 | + params: {}, |
| 74 | + message: 'should match some schema in anyOf' |
| 75 | + }, |
| 76 | + { |
| 77 | + keyword: 'if', |
| 78 | + dataPath: '', |
| 79 | + schemaPath: '#/allOf/1/allOf/9/if', |
| 80 | + params: { |
| 81 | + failingKeyword: 'then' |
93 | 82 | },
|
94 |
| - { |
95 |
| - keyword: "oneOf", |
96 |
| - dataPath: "", |
97 |
| - schemaPath: "#/oneOf", |
98 |
| - params: { |
99 |
| - passingSchemas: null |
100 |
| - }, |
101 |
| - message: "should match exactly one schema in oneOf" |
102 |
| - } |
| 83 | + message: 'should match "then" schema' |
| 84 | + }, |
| 85 | + { |
| 86 | + keyword: 'type', |
| 87 | + dataPath: '', |
| 88 | + schemaPath: '#/oneOf/1/type', |
| 89 | + params: { |
| 90 | + type: 'array' |
| 91 | + }, |
| 92 | + message: 'should be array' |
| 93 | + }, |
| 94 | + { |
| 95 | + keyword: 'oneOf', |
| 96 | + dataPath: '', |
| 97 | + schemaPath: '#/oneOf', |
| 98 | + params: { |
| 99 | + passingSchemas: null |
| 100 | + }, |
| 101 | + message: 'should match exactly one schema in oneOf' |
| 102 | + } |
103 | 103 | ];
|
0 commit comments