You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ma...@apache.org on 2021/10/28 23:38:27 UTC
[camel-karavan] branch main updated: Kamelet dsl (#56)
This is an automated email from the ASF dual-hosted git repository.
marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
The following commit(s) were added to refs/heads/main by this push:
new 5a628bf Kamelet dsl (#56)
5a628bf is described below
commit 5a628bf5181d2d0cc73c460107b2f25b5c33ea96
Author: Marat Gubaidullin <ma...@gmail.com>
AuthorDate: Thu Oct 28 19:38:24 2021 -0400
Kamelet dsl (#56)
* Kamelet YAML DSL for sink and action Kamelets
* Fix #43
* Fix kamelet icons
---
karavan-designer/src/designer/api/CamelApi.tsx | 27 ++++--
karavan-designer/src/designer/api/CamelApiExt.tsx | 26 ++---
.../src/designer/api/CamelMetadata.tsx | 5 +
karavan-designer/src/designer/api/CamelUi.tsx | 44 +++++----
karavan-designer/src/designer/api/EventBus.tsx | 2 +-
karavan-designer/src/designer/api/KameletApi.tsx | 24 ++---
karavan-designer/src/designer/karavan.css | 16 +--
karavan-designer/src/designer/model/CamelModel.tsx | 19 ++++
.../src/designer/model/ConnectionModels.tsx | 8 +-
.../src/designer/model/DslMetaModel.tsx | 1 +
.../src/designer/model/KameletModels.tsx | 12 +--
.../src/designer/ui/DslConnections.tsx | 38 +++++---
karavan-designer/src/designer/ui/DslElement.tsx | 2 +-
karavan-designer/src/designer/ui/DslInOut.tsx | 15 ++-
karavan-designer/src/designer/ui/DslPath.tsx | 19 +++-
karavan-designer/src/designer/ui/DslSelector.tsx | 16 ++-
.../src/designer/ui/KaravanDesigner.tsx | 12 ++-
.../karavan/generator/CamelModelGenerator.java | 8 +-
.../src/main/resources/camel-yaml-dsl.json | 108 ++++++++++++++++++++-
19 files changed, 299 insertions(+), 103 deletions(-)
diff --git a/karavan-designer/src/designer/api/CamelApi.tsx b/karavan-designer/src/designer/api/CamelApi.tsx
index d8b4d56..5911a2b 100644
--- a/karavan-designer/src/designer/api/CamelApi.tsx
+++ b/karavan-designer/src/designer/api/CamelApi.tsx
@@ -38,10 +38,11 @@ import { CamelElement,
RoutingSlipStep,
BeanStep,
RecipientListStep,
+ KameletStep,
DynamicRouterStep,
RollbackStep,
- EnrichStep,
InOutStep,
+ EnrichStep,
SplitStep,
WireTapStep,
MulticastStep,
@@ -128,10 +129,11 @@ export class CamelApi {
case 'routingSlip': return CamelApi.createRoutingSlip(body)
case 'bean': return CamelApi.createBean(body)
case 'recipientList': return CamelApi.createRecipientList(body)
+ case 'kamelet': return CamelApi.createKamelet(body)
case 'dynamicRouter': return CamelApi.createDynamicRouter(body)
case 'rollback': return CamelApi.createRollback(body)
- case 'enrich': return CamelApi.createEnrich(body)
case 'inOut': return CamelApi.createInOut(body)
+ case 'enrich': return CamelApi.createEnrich(body)
case 'split': return CamelApi.createSplit(body)
case 'wireTap': return CamelApi.createWireTap(body)
case 'multicast': return CamelApi.createMulticast(body)
@@ -397,6 +399,12 @@ export class CamelApi {
return recipientListStep
}
+ static createKamelet = (element: any): KameletStep => {
+ const kameletStep = element ? new KameletStep({...element.kamelet}) : new KameletStep()
+ kameletStep.uuid = element?.uuid ? element.uuid : kameletStep.uuid
+ return kameletStep
+ }
+
static createDynamicRouter = (element: any): DynamicRouterStep => {
const dynamicRouterStep = element ? new DynamicRouterStep({...element.dynamicRouter}) : new DynamicRouterStep()
dynamicRouterStep.dynamicRouter.expression = CamelApi.createExpression(element?.dynamicRouter?.expression)
@@ -410,6 +418,12 @@ export class CamelApi {
return rollbackStep
}
+ static createInOut = (element: any): InOutStep => {
+ const inOutStep = element ? new InOutStep({...element.inOut}) : new InOutStep()
+ inOutStep.uuid = element?.uuid ? element.uuid : inOutStep.uuid
+ return inOutStep
+ }
+
static createEnrich = (element: any): EnrichStep => {
const enrichStep = element ? new EnrichStep({...element.enrich}) : new EnrichStep()
enrichStep.enrich.expression = CamelApi.createExpression(element?.enrich?.expression)
@@ -417,12 +431,6 @@ export class CamelApi {
return enrichStep
}
- static createInOut = (element: any): InOutStep => {
- const inOutStep = element ? new InOutStep({...element.inOut}) : new InOutStep()
- inOutStep.uuid = element?.uuid ? element.uuid : inOutStep.uuid
- return inOutStep
- }
-
static createSplit = (element: any): SplitStep => {
const splitStep = element ? new SplitStep({...element.split}) : new SplitStep()
splitStep.split.expression = CamelApi.createExpression(element?.split?.expression)
@@ -650,10 +658,11 @@ export class CamelApi {
case 'routingSlipStep': return (step as RoutingSlipStep).routingSlip
case 'beanStep': return (step as BeanStep).bean
case 'recipientListStep': return (step as RecipientListStep).recipientList
+ case 'kameletStep': return (step as KameletStep).kamelet
case 'dynamicRouterStep': return (step as DynamicRouterStep).dynamicRouter
case 'rollbackStep': return (step as RollbackStep).rollback
- case 'enrichStep': return (step as EnrichStep).enrich
case 'inOutStep': return (step as InOutStep).inOut
+ case 'enrichStep': return (step as EnrichStep).enrich
case 'splitStep': return (step as SplitStep).split
case 'wireTapStep': return (step as WireTapStep).wireTap
case 'multicastStep': return (step as MulticastStep).multicast
diff --git a/karavan-designer/src/designer/api/CamelApiExt.tsx b/karavan-designer/src/designer/api/CamelApiExt.tsx
index e713126..e97dbb9 100644
--- a/karavan-designer/src/designer/api/CamelApiExt.tsx
+++ b/karavan-designer/src/designer/api/CamelApiExt.tsx
@@ -131,35 +131,37 @@ export class CamelApiExt {
}
}
- static getToStepsFromIntegration = (integration: Integration): CamelElement[] => {
- const result: CamelElement[] = [];
+ static getToStepsFromIntegration = (integration: Integration): [CamelElement, number][] => {
+ const result: [CamelElement, number][] = [];
integration.spec.flows.forEach((flow, index) => {
- const steps: CamelElement[] = CamelApiExt.getToStepsFromStep(flow.from);
+ const steps: [CamelElement, number][] = CamelApiExt.getOutgoingStepsFromStep(flow.from, 0);
result.push(...steps);
})
return result;
}
- static getToStepsFromStep = (step: ProcessorStep): CamelElement[] => {
- const result: CamelElement[] = [];
- if (step.dslName === 'toStep') result.push(step);
+ static getOutgoingStepsFromStep = (step: ProcessorStep, level: number): [CamelElement, number][] => {
+ const result: [CamelElement, number][] = [];
+ if (['toStep', 'kameletStep'].includes(step.dslName)) result.push([step, level]);
const element: any = Object.assign({}, step);
Object.keys(element).forEach(key => {
if (element[key] instanceof CamelElement) {
- const steps = CamelApiExt.getToStepsFromStep(element[key]);
+ const steps = CamelApiExt.getOutgoingStepsFromStep(element[key], level + 1);
result.push(...steps);
} else if (Array.isArray(element[key])) {
- const steps = CamelApiExt.getStepsFromSteps(element[key]);
+ const parallel = element.dslName === 'multicast' || element.dslName === 'choice';
+ const increase = element.dslName === 'otherwise' ? 3 : 1;
+ const steps = CamelApiExt.getStepsFromSteps(element[key], level + increase, parallel);
result.push(...steps);
}
})
return result;
}
- static getStepsFromSteps = (steps: CamelElement[]): CamelElement[] => {
- const result: CamelElement[] = [];
- steps.forEach(step => {
- const steps = CamelApiExt.getToStepsFromStep(step);
+ static getStepsFromSteps = (steps: CamelElement[], level: number, parallel: boolean): [CamelElement, number][] => {
+ const result: [CamelElement, number][] = [];
+ steps.forEach((step,index) => {
+ const steps = CamelApiExt.getOutgoingStepsFromStep(step, level + (parallel ? 1 : index));
result.push(...steps);
})
return result;
diff --git a/karavan-designer/src/designer/api/CamelMetadata.tsx b/karavan-designer/src/designer/api/CamelMetadata.tsx
index a81553f..63231fa 100644
--- a/karavan-designer/src/designer/api/CamelMetadata.tsx
+++ b/karavan-designer/src/designer/api/CamelMetadata.tsx
@@ -456,6 +456,11 @@ export const Metadata: ElementMeta[] = [
new PropertyMeta('serviceFilterRef', 'Service Filter Ref', "Sets a reference to a custom ServiceFilter to use.", 'string', '', false, false, false, false),
new PropertyMeta('uri', 'Uri', "The uri of the endpoint to send to. The uri can be dynamic computed using the org.apache.camel.language.simple.SimpleLanguage expression.", 'string', '', false, false, false, false),
]),
+ new ElementMeta('kamelet', 'Kamelet', 'To call Kamelets', 'eip,routing,kamelet', [
+ new PropertyMeta('inheritErrorHandler', 'inheritErrorHandler', "inheritErrorHandler", 'boolean', '', false, false, false, false),
+ new PropertyMeta('name', 'Name', "Name of the Kamelet (templateId/routeId) to call. Options for the kamelet can be specified using uri syntax, eg mynamecount=4&type=gold.", 'string', '', true, false, false, false),
+ new PropertyMeta('parameters', 'parameters', "parameters", 'object', '', false, false, false, false),
+ ]),
new ElementMeta('sample', 'Sample', 'Extract a sample of the messages passing through a route', 'eip,routing', [
new PropertyMeta('inheritErrorHandler', 'inheritErrorHandler', "inheritErrorHandler", 'boolean', '', false, false, false, false),
new PropertyMeta('messageFrequency', 'Message Frequency', "Sets the sample message count which only a single Exchange will pass through after this many received.", 'number', '', false, false, false, false),
diff --git a/karavan-designer/src/designer/api/CamelUi.tsx b/karavan-designer/src/designer/api/CamelUi.tsx
index a638032..6ff11e1 100644
--- a/karavan-designer/src/designer/api/CamelUi.tsx
+++ b/karavan-designer/src/designer/api/CamelUi.tsx
@@ -16,13 +16,14 @@
*/
import {KameletApi} from "./KameletApi";
import {CamelElement} from "../model/CamelModel";
-import {Kamelet, Property} from "../model/KameletModels";
+import {KameletModel, Property} from "../model/KameletModels";
import {DslMetaModel} from "../model/DslMetaModel";
import {Metadata} from "./CamelMetadata";
import {ComponentApi} from "./ComponentApi";
import {ComponentProperty} from "../model/ComponentModels";
import {CamelApiExt} from "./CamelApiExt";
import {CamelApi} from "./CamelApi";
+import {Kamelet} from "../model/CamelModel";
const DslElements: string[] = [
"aggregate",
@@ -34,6 +35,7 @@ const DslElements: string[] = [
"enrich",
"filter",
"log",
+ // "kamelet",
"loop",
"marshal",
"multicast",
@@ -97,7 +99,7 @@ export class CamelUi {
return Metadata.filter((m) => m.name === "from").map(
(m) =>
new DslMetaModel({
- name: m.name,
+ dsl: m.name,
title: m.title,
description: m.description,
})
@@ -108,7 +110,7 @@ export class CamelUi {
).map(
(m) =>
new DslMetaModel({
- name: m.name,
+ dsl: m.name,
title: m.title,
description: m.description,
})
@@ -119,7 +121,7 @@ export class CamelUi {
.map(
(m) =>
new DslMetaModel({
- name: m.name,
+ dsl: m.name,
title: m.title,
description: m.description,
})
@@ -133,7 +135,7 @@ export class CamelUi {
.map(
(c) =>
new DslMetaModel({
- name: parentDslName ? "to" : "from",
+ dsl: parentDslName ? "to" : "from",
uri: c.component.name,
title: c.component.title,
description: c.component.description,
@@ -147,8 +149,9 @@ export class CamelUi {
.map(
(k) =>
new DslMetaModel({
- name: parentDslName ? "to" : "from",
- uri: "kamelet:" + k.metadata.name,
+ dsl: parentDslName ? "kamelet" : "from",
+ uri: parentDslName ? undefined : "kamelet:" + k.metadata.name,
+ name: k.metadata.name,
title: k.title(),
description: k.title(),
})
@@ -173,7 +176,9 @@ export class CamelUi {
};
static isKameletComponent = (element: CamelElement | undefined): boolean => {
- if (element && ["from", "to"].includes(element.dslName)) {
+ if (element?.dslName === 'kamelet') {
+ return true;
+ } else if (element && ["from", "to"].includes(element.dslName)) {
const uri: string = (element as any).uri;
return uri !== undefined && uri.startsWith("kamelet:");
} else {
@@ -181,8 +186,10 @@ export class CamelUi {
}
};
- static getKamelet = (element: CamelElement): Kamelet | undefined => {
- if (["from", "to"].includes(element.dslName)) {
+ static getKamelet = (element: CamelElement): KameletModel | undefined => {
+ if (element.dslName === 'kamelet') {
+ return KameletApi.findKameletByName((element as Kamelet).name || '');
+ } else if (["from", "to"].includes(element.dslName)) {
const uri: string = (element as any).uri;
const k =
uri !== undefined ? KameletApi.findKameletByUri(uri) : undefined;
@@ -193,8 +200,7 @@ export class CamelUi {
};
static getKameletProperties = (element: any): Property[] => {
- const uri: string = (element as any).uri;
- const kamelet = KameletApi.findKameletByUri(uri);
+ const kamelet = CamelUi.getKamelet(element)
return kamelet
? KameletApi.getKameletProperties(kamelet?.metadata.name)
: [];
@@ -213,7 +219,7 @@ export class CamelUi {
static getTitle = (element: CamelElement): string => {
const uri: string = (element as any).uri;
- const k: Kamelet | undefined = CamelUi.getKamelet(element);
+ const k: KameletModel | undefined = CamelUi.getKamelet(element);
if (k) {
return k.title();
} else {
@@ -243,9 +249,13 @@ export class CamelUi {
return (element as any).uri;
}
- static getKameletIcon = (uri: string | undefined): string => {
+ static getKameletIconByUri = (uri: string | undefined): string => {
return uri ? KameletApi.findKameletByUri(uri)?.icon() || "" : "";
- };
+ }
+
+ static getKameletIconByName = (name: string | undefined): string => {
+ return name ? KameletApi.findKameletByName(name)?.icon() || "" : "";
+ }
static getIconForName = (dslName: string): string => {
switch (dslName) {
@@ -277,8 +287,8 @@ export class CamelUi {
};
static getIcon = (element: CamelElement): string => {
- const k: Kamelet | undefined = CamelUi.getKamelet(element);
- if (["from", "to"].includes(element.dslName)) {
+ const k: KameletModel | undefined = CamelUi.getKamelet(element);
+ if (["from", "kamelet"].includes(element.dslName)) {
return k ? k.icon() : defaultIcon;
} else {
return CamelUi.getIconForName(element.dslName);
diff --git a/karavan-designer/src/designer/api/EventBus.tsx b/karavan-designer/src/designer/api/EventBus.tsx
index 8f26db4..277cef6 100644
--- a/karavan-designer/src/designer/api/EventBus.tsx
+++ b/karavan-designer/src/designer/api/EventBus.tsx
@@ -32,7 +32,7 @@ export class DslPosition {
}
export class InOutPosition {
- inout: InOut = new InOut('in', '', 0, 0)
+ inout: InOut = new InOut('in', '', 0, 0, 0)
rect: DOMRect = new DOMRect()
constructor(inout: InOut, rect: DOMRect) {
diff --git a/karavan-designer/src/designer/api/KameletApi.tsx b/karavan-designer/src/designer/api/KameletApi.tsx
index 3744d7f..24c0169 100644
--- a/karavan-designer/src/designer/api/KameletApi.tsx
+++ b/karavan-designer/src/designer/api/KameletApi.tsx
@@ -14,15 +14,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import {Kamelet, Property} from "../model/KameletModels";
+import {KameletModel, Property} from "../model/KameletModels";
import * as yaml from 'js-yaml';
-export const Kamelets: Kamelet[] = [];
+export const Kamelets: KameletModel[] = [];
export const KameletApi = {
getKameletProperties: (kameletName: string): Property[] => {
- const kamelet: Kamelet | undefined = KameletApi.findKameletByName(kameletName);
+ const kamelet: KameletModel | undefined = KameletApi.findKameletByName(kameletName);
const properties: Property[] = [];
try {
if (kamelet !== undefined) {
@@ -46,32 +46,32 @@ export const KameletApi = {
}
},
- getKamelets: (): Kamelet[] => {
+ getKamelets: (): KameletModel[] => {
return Kamelets;
},
jsonToKamelet: (json: string) => {
- const fromJson: Kamelet = JSON.parse(json) as Kamelet;
- const k: Kamelet = new Kamelet(fromJson);
+ const fromJson: KameletModel = JSON.parse(json) as KameletModel;
+ const k: KameletModel = new KameletModel(fromJson);
return k;
},
- findKameletByName: (name: string): Kamelet | undefined => {
- return Kamelets.find((k: Kamelet) => k.metadata.name === name);
+ findKameletByName: (name: string): KameletModel | undefined => {
+ return Kamelets.find((k: KameletModel) => k.metadata.name === name);
},
- findKameletByUri: (uri: string): Kamelet | undefined => {
+ findKameletByUri: (uri: string): KameletModel | undefined => {
return KameletApi.findKameletByName(uri.split(":")[1]);
},
- yamlToKamelet: (text: string):Kamelet => {
+ yamlToKamelet: (text: string):KameletModel => {
const fromYaml = yaml.load(text);
return KameletApi.jsonToKamelet(JSON.stringify(fromYaml));
},
saveKamelets: (kameletYamls: string[]) => {
- const kamelets:Kamelet[] = kameletYamls.map(text => KameletApi.yamlToKamelet(text));
+ const kamelets:KameletModel[] = kameletYamls.map(text => KameletApi.yamlToKamelet(text));
Kamelets.push(...kamelets.sort((a, b) => {
if (a.spec.definition.title < b.spec.definition.title) {
return -1;
@@ -82,7 +82,7 @@ export const KameletApi = {
},
saveKamelet: (yaml: string) => {
- const kamelet:Kamelet = KameletApi.yamlToKamelet(yaml);
+ const kamelet:KameletModel = KameletApi.yamlToKamelet(yaml);
Kamelets.push(kamelet);
}
}
\ No newline at end of file
diff --git a/karavan-designer/src/designer/karavan.css b/karavan-designer/src/designer/karavan.css
index 34eb357..573131b 100644
--- a/karavan-designer/src/designer/karavan.css
+++ b/karavan-designer/src/designer/karavan.css
@@ -339,11 +339,11 @@
.karavan .dsl-page .flows .connections .incoming {
border-color: #fb8824;
border-style: solid;
- border-radius: 50px;
+ border-radius: 40px;
border-width: 1px;
background: #fff;
- width: 50px;
- height: 50px;
+ width: 40px;
+ height: 40px;
position: absolute;
left: 6px;
display: flex;
@@ -352,11 +352,11 @@
.karavan .dsl-page .flows .connections .outgoing {
border-color: #fb8824;
border-style: solid;
- border-radius: 50px;
+ border-radius: 40px;
border-width: 1px;
background: #fff;
- width: 50px;
- height: 50px;
+ width: 40px;
+ height: 40px;
position: absolute;
right: 1px;
display: flex;
@@ -364,7 +364,7 @@
.karavan .dsl-page .flows .connections .incoming .icon,
.karavan .dsl-page .flows .connections .outgoing .icon {
- height: 36px;
+ height: 32px;
margin: auto;
}
@@ -372,7 +372,7 @@
.karavan .dsl-page .flows .connections .outgoing .inout-name {
margin: auto;
overflow: hidden;
- font-size: 16px;
+ font-size: 24px;
font-weight: bold;
}
diff --git a/karavan-designer/src/designer/model/CamelModel.tsx b/karavan-designer/src/designer/model/CamelModel.tsx
index 71f92cc..94c2567 100644
--- a/karavan-designer/src/designer/model/CamelModel.tsx
+++ b/karavan-designer/src/designer/model/CamelModel.tsx
@@ -1147,6 +1147,25 @@ export class ServiceCallStep extends ProcessorStep {
}
}
+export class Kamelet extends CamelElement {
+ inheritErrorHandler?: boolean
+ name?: string
+ parameters?: any
+
+ public constructor(init?: Partial<Kamelet>) {
+ super('kamelet')
+ Object.assign(this, init)
+ }
+}
+export class KameletStep extends ProcessorStep {
+ kamelet: Kamelet = new Kamelet()
+
+ public constructor(init?: Partial<Kamelet>) {
+ super('kameletStep')
+ Object.assign(this, {kamelet: new Kamelet({...init})})
+ }
+}
+
export class Sample extends CamelElement {
inheritErrorHandler?: boolean
messageFrequency?: number
diff --git a/karavan-designer/src/designer/model/ConnectionModels.tsx b/karavan-designer/src/designer/model/ConnectionModels.tsx
index 4dc0d3d..a9a6c6a 100644
--- a/karavan-designer/src/designer/model/ConnectionModels.tsx
+++ b/karavan-designer/src/designer/model/ConnectionModels.tsx
@@ -20,16 +20,18 @@ export class InOut {
uuid: string = ''
top: number = 0;
side: number = 0;
+ index: number = 0;
icon?: string;
name?: string;
- constructor(type: 'in' | 'out', uuid: string, top: number, side: number, icon?: string, name?: string) {
+ constructor(type: 'in' | 'out', uuid: string, top: number, side: number, index: number, icon?: string, name?: string) {
this.type = type;
this.uuid = uuid;
this.icon = icon;
this.top = top;
this.side = side;
this.name = name;
+ this.index = index;
}
}
@@ -39,13 +41,15 @@ export class Path {
startY: number = 0
endX: number = 0
endY: number = 0
+ index: number = 0;
- constructor(uuid: string, startX: number, startY: number, endX: number, endY: number) {
+ constructor(uuid: string, startX: number, startY: number, endX: number, endY: number, index: number) {
this.uuid = uuid;
this.startX = startX;
this.startY = startY;
this.endX = endX;
this.endY = endY;
+ this.index = index;
}
getPath(): string {
diff --git a/karavan-designer/src/designer/model/DslMetaModel.tsx b/karavan-designer/src/designer/model/DslMetaModel.tsx
index 88d82bc..68d72e9 100644
--- a/karavan-designer/src/designer/model/DslMetaModel.tsx
+++ b/karavan-designer/src/designer/model/DslMetaModel.tsx
@@ -15,6 +15,7 @@
* limitations under the License.
*/
export class DslMetaModel {
+ dsl: string = ''
name: string = ''
uri?: string
title: string = ''
diff --git a/karavan-designer/src/designer/model/KameletModels.tsx b/karavan-designer/src/designer/model/KameletModels.tsx
index 6a0f14c..a7353f9 100644
--- a/karavan-designer/src/designer/model/KameletModels.tsx
+++ b/karavan-designer/src/designer/model/KameletModels.tsx
@@ -73,13 +73,13 @@ export class KameletMetadata {
}
}
-export class Kamelet {
+export class KameletModel {
apiVersion: string = 'camel.apache.org/v1alpha1';
kind: string = 'Kamelet';
metadata: KameletMetadata = new KameletMetadata();
spec: KameletSpec = new KameletSpec();
- public constructor(init?: Partial<Kamelet>) {
+ public constructor(init?: Partial<KameletModel>) {
Object.assign(this, init);
}
@@ -99,11 +99,11 @@ export class Kamelet {
return this.spec.definition.properties;
}
- static default = (): Kamelet[] => defaultKamelets;
+ static default = (): KameletModel[] => defaultKamelets;
}
-const defaultKamelets: Kamelet[] = [
- new Kamelet({
+const defaultKamelets: KameletModel[] = [
+ new KameletModel({
kind: 'uri',
apiVersion: '',
metadata: new KameletMetadata({
@@ -113,7 +113,7 @@ const defaultKamelets: Kamelet[] = [
}),
spec: new KameletSpec({ definition: new Definition({ title: 'URI source' }) })
}),
- new Kamelet({
+ new KameletModel({
kind: 'uri',
apiVersion: '',
metadata: new KameletMetadata({
diff --git a/karavan-designer/src/designer/ui/DslConnections.tsx b/karavan-designer/src/designer/ui/DslConnections.tsx
index b941301..64eecb3 100644
--- a/karavan-designer/src/designer/ui/DslConnections.tsx
+++ b/karavan-designer/src/designer/ui/DslConnections.tsx
@@ -17,7 +17,7 @@
import React from 'react';
import '../karavan.css';
import {InOut, Path} from "../model/ConnectionModels";
-import {Integration} from "../model/CamelModel";
+import {CamelElement, Integration} from "../model/CamelModel";
import {Subscription} from "rxjs";
import {CamelUi} from "../api/CamelUi";
import {CamelApiExt} from "../api/CamelApiExt";
@@ -70,11 +70,11 @@ export class DslConnections extends React.Component<Props, State> {
if (uri && uri.startsWith("kamelet")) {
const kamelet = KameletApi.findKameletByUri(uri);
if (kamelet && kamelet.metadata.labels["camel.apache.org/kamelet.type"] === 'source') {
- const i = new InOut('in', flow.uuid, index * 60, 0, CamelUi.getIcon(flow.from));
+ const i = new InOut('in', flow.uuid, index * 60, 0, 0, CamelUi.getIcon(flow.from));
result.push(i);
}
} else if (uri && !uri.startsWith("kamelet")) {
- const i = new InOut('in', flow.uuid, index * 60, 0, undefined, ComponentApi.getComponentNameFromUri(uri));
+ const i = new InOut('in', flow.uuid, index * 60, 0, 0, undefined, ComponentApi.getComponentNameFromUri(uri));
result.push(i);
}
})
@@ -83,18 +83,24 @@ export class DslConnections extends React.Component<Props, State> {
getOutgoings(): InOut[] {
const result: InOut[] = [];
- CamelApiExt.getToStepsFromIntegration(this.state.integration).forEach((element, index) => {
- const uri: string = (element as any).to.uri;
- if (uri && uri.startsWith("kamelet")) {
- const kamelet = KameletApi.findKameletByUri(uri);
- if (kamelet && kamelet.metadata.labels["camel.apache.org/kamelet.type"] === 'sink') {
- const i = new InOut('out', element.uuid, index * 60, 500, CamelUi.getIcon((element as any).to));
+ const toSteps: [CamelElement, number][] = CamelApiExt.getToStepsFromIntegration(this.state.integration);
+ const set = new Set(toSteps.map(value => value[1]));
+ set.forEach((level) => {
+ toSteps.filter(data => data[1] === level).forEach((data, index, all) => {
+ const element: CamelElement = data[0];
+ if ((element as any).to) {
+ const uri: string = (element as any).to.uri;
+ const i = new InOut('out', element.uuid, index * 60, 500, index, undefined, ComponentApi.getComponentNameFromUri(uri));
result.push(i);
+ } else if ((element as any).kamelet) {
+ const name: string = (element as any).kamelet.name;
+ const kamelet = KameletApi.findKameletByName(name);
+ if (kamelet && kamelet.metadata.labels["camel.apache.org/kamelet.type"] === 'sink') {
+ const i = new InOut('out', element.uuid, index * 60, 500, index, CamelUi.getIcon((element as any).kamelet), undefined);
+ result.push(i);
+ }
}
- } else if (uri && !uri.startsWith("kamelet")) {
- const i = new InOut('out', element.uuid, index * 60, 500, undefined, ComponentApi.getComponentNameFromUri(uri));
- result.push(i);
- }
+ })
})
return result;
}
@@ -102,11 +108,11 @@ export class DslConnections extends React.Component<Props, State> {
getPath(): Path[] {
const result: Path[] = [];
this.getIncomings().forEach((i, index) => {
- const path = new Path(i.uuid, 66, i.top + 25, 66, i.top + 25);
+ const path = new Path(i.uuid, 66, i.top + 25, 66, i.top + 25, i.index);
result.push(path);
})
this.getOutgoings().forEach((i, index) => {
- const path = new Path(i.uuid, 666, i.top + 25, 666, i.top + 25);
+ const path = new Path(i.uuid, 666, i.top + 25, 666, i.top + 25, i.index);
result.push(path);
})
return result;
@@ -115,7 +121,7 @@ export class DslConnections extends React.Component<Props, State> {
render() {
return (
<div className="connections">
- {this.getPath().map(path => <DslPath key={path.uuid} uuid={path.uuid}/>)}
+ {this.getPath().map(path => <DslPath key={path.uuid} uuid={path.uuid} path={path}/>)}
{this.getIncomings().map((i: InOut) =>
<DslInOut key={i.uuid} inout={i}/>
)}
diff --git a/karavan-designer/src/designer/ui/DslElement.tsx b/karavan-designer/src/designer/ui/DslElement.tsx
index 10a5e1a..4080083 100644
--- a/karavan-designer/src/designer/ui/DslElement.tsx
+++ b/karavan-designer/src/designer/ui/DslElement.tsx
@@ -122,7 +122,7 @@ export class DslElement extends React.Component<Props, State> {
: {fontWeight: this.isSelected() ? "bold" : "normal"}
}
ref={el => {
- if (el && (this.state.step.dslName === 'fromStep' || this.state.step.dslName === 'toStep')) EventBus.sendPosition(this.state.step, el.getBoundingClientRect());
+ if (el && (this.state.step.dslName === 'fromStep' || this.state.step.dslName === 'toStep' || this.state.step.dslName === 'kameletStep')) EventBus.sendPosition(this.state.step, el.getBoundingClientRect());
}}>
<img draggable={false}
src={CamelUi.getIcon(this.state.element)}
diff --git a/karavan-designer/src/designer/ui/DslInOut.tsx b/karavan-designer/src/designer/ui/DslInOut.tsx
index 4ec415f..8ebff00 100644
--- a/karavan-designer/src/designer/ui/DslInOut.tsx
+++ b/karavan-designer/src/designer/ui/DslInOut.tsx
@@ -59,18 +59,27 @@ export class DslInOut extends React.Component<Props, State> {
}
getTop() {
- return this.state.fRect ? this.state.top - this.state.fRect?.top : this.state.top;
+ if (this.state.fRect) {
+ return (this.state.top + this.state.inout.index * 10) - this.state.fRect?.top;
+ } else {
+ return this.state.top + this.state.inout.index * 10;
+ }
+ }
+
+ getRight() {
+ return this.state.inout.index * 15;
}
render() {
return (
<div className={this.state.inout.type === 'out' ? 'outgoing' : 'incoming'}
- style={{top: this.getTop() + 'px'}}>
+ style={{top: this.getTop() + 'px', right: this.getRight() + 'px'}}>
{this.state.inout.icon && <img draggable={false}
src={this.state.inout.icon}
className="icon" alt="icon">
</img>}
- {this.state.inout.name && <Text className="inout-name">{this.state.inout.name.substr(0, 1).toUpperCase()}</Text>}
+ {this.state.inout.name &&
+ <Text className="inout-name">{this.state.inout.name.substr(0, 1).toUpperCase()}</Text>}
</div>
);
}
diff --git a/karavan-designer/src/designer/ui/DslPath.tsx b/karavan-designer/src/designer/ui/DslPath.tsx
index d8dc520..2dee3fe 100644
--- a/karavan-designer/src/designer/ui/DslPath.tsx
+++ b/karavan-designer/src/designer/ui/DslPath.tsx
@@ -18,9 +18,11 @@ import React from 'react';
import '../karavan.css';
import {Subscription} from "rxjs";
import {DslPosition, EventBus} from "../api/EventBus";
+import {Path} from "../model/ConnectionModels";
interface Props {
uuid: string,
+ path: Path,
}
interface State {
@@ -63,18 +65,27 @@ export class DslPath extends React.Component<Props, State> {
setPosition(evt: DslPosition) {
if (evt.step.dslName === 'fromStep'){
- this.setState({inout:"in", left: 56, top: (evt.rect.top + 25), width: (evt.rect.x) - 56});
+ this.setState({inout:"in", left: 46, top: (evt.rect.top + 20), width: (evt.rect.x) - 46});
} else {
- this.setState({inout:"out", left: evt.rect.x + evt.rect.width, top: (evt.rect.top + 25), width: (evt.rect.x + evt.rect.width + 200)});
+ this.setState({inout:"out", left: evt.rect.x + evt.rect.width, top: (evt.rect.top + 20), width: (evt.rect.x + evt.rect.width + 200)});
}
}
getTop(){
- return this.state.fRect ? this.state.top - this.state.fRect.top : this.state.top;
+ if (this.state.fRect){
+ return (this.state.top + this.props.path.index * 10) - this.state.fRect?.top;
+ } else {
+ return this.state.top + this.props.path.index * 10;
+ }
}
getWidth(){
- return this.state.fRect && this.state.inout === 'out' ? this.state.fRect.width - this.state.left : this.state.width;
+ if (this.state.fRect && this.state.inout === 'out'){
+ return this.state.fRect.width - this.state.left - (this.props.path.index * 10) - 20;
+ } else {
+ return this.state.width;
+ }
+ // return this.state.fRect && this.state.inout === 'out' ? this.state.fRect.width - this.state.left : this.state.width;
}
render() {
diff --git a/karavan-designer/src/designer/ui/DslSelector.tsx b/karavan-designer/src/designer/ui/DslSelector.tsx
index 76b4ebb..e35cb9e 100644
--- a/karavan-designer/src/designer/ui/DslSelector.tsx
+++ b/karavan-designer/src/designer/ui/DslSelector.tsx
@@ -88,6 +88,16 @@ export class DslSelector extends React.Component<Props, State> {
)
}
+ getIcon = (dsl: DslMetaModel): string => {
+ if (dsl.dsl && dsl.dsl === "kamelet") {
+ return CamelUi.getKameletIconByName(dsl.name);
+ } else if (dsl.dsl && dsl.dsl === "from" && dsl.uri?.startsWith("kamelet")){
+ return CamelUi.getKameletIconByUri(dsl.uri);
+ } else {
+ return CamelUi.getIconForName(dsl.dsl);
+ }
+ }
+
render() {
return (
<Modal
@@ -108,12 +118,12 @@ export class DslSelector extends React.Component<Props, State> {
{CamelUi.sortSelectorModels(CamelUi.getSelectorModels(label[0], label[1], this.props.parentType))
.filter(dsl =>this.checkFilter(dsl))
.map((dsl, index) => (
- <Card key={dsl.name + index} isHoverable isCompact className="dsl-card"
+ <Card key={dsl.dsl + index} isHoverable isCompact className="dsl-card"
onClick={event => this.selectDsl(event, dsl)}>
<CardHeader>
<img draggable={false}
- src={dsl.uri && dsl.uri.startsWith("kamelet") ? CamelUi.getKameletIcon(dsl.uri) : CamelUi.getIconForName(dsl.name)}
- style={dsl.name === 'choice' ? {height: "18px"} : {}} // find better icon
+ src={this.getIcon(dsl)}
+ style={dsl.dsl === 'choice' ? {height: "18px"} : {}} // find better icon
className="icon" alt="icon"></img>
<Text>{dsl.title}</Text>
</CardHeader>
diff --git a/karavan-designer/src/designer/ui/KaravanDesigner.tsx b/karavan-designer/src/designer/ui/KaravanDesigner.tsx
index aa867cd..bce1856 100644
--- a/karavan-designer/src/designer/ui/KaravanDesigner.tsx
+++ b/karavan-designer/src/designer/ui/KaravanDesigner.tsx
@@ -125,17 +125,21 @@ export class KaravanDesigner extends React.Component<Props, State> {
}
onDslSelect = (dsl: DslMetaModel, parentId: string) => {
- switch (dsl.name) {
+ switch (dsl.dsl) {
case 'from' :
- const from = CamelApi.createStep(dsl.name, {from: {uri: dsl.uri}});
+ const from = CamelApi.createStep(dsl.dsl, {from: {uri: dsl.uri}});
this.addStep(from, parentId)
break;
case 'to' :
- const to = CamelApi.createStep(dsl.name, {to: {uri: dsl.uri}});
+ const to = CamelApi.createStep(dsl.dsl, {to: {uri: dsl.uri}});
this.addStep(to, parentId)
break;
+ case 'kamelet' :
+ const kamelet = CamelApi.createStep(dsl.dsl, {kamelet: {name: dsl.name}});
+ this.addStep(kamelet, parentId)
+ break;
default:
- const step = CamelApi.createStep(dsl.name, {});
+ const step = CamelApi.createStep(dsl.dsl, {});
this.addStep(step, parentId)
break;
}
diff --git a/karavan-generator/src/main/java/org/apache/camel/karavan/generator/CamelModelGenerator.java b/karavan-generator/src/main/java/org/apache/camel/karavan/generator/CamelModelGenerator.java
index db781b3..254b5c8 100644
--- a/karavan-generator/src/main/java/org/apache/camel/karavan/generator/CamelModelGenerator.java
+++ b/karavan-generator/src/main/java/org/apache/camel/karavan/generator/CamelModelGenerator.java
@@ -75,7 +75,7 @@ public final class CamelModelGenerator {
// fill processors name + class
Map<String, String> processors = new HashMap();
procList.getMap().entrySet().stream()
- .filter(e -> !e.getKey().equals("step") && !e.getKey().equals("kamelet"))
+ .filter(e -> !e.getKey().equals("step") )
.collect(Collectors.toMap(
e -> e.getKey(),
e -> e.getValue()
@@ -85,7 +85,7 @@ public final class CamelModelGenerator {
processors.put(className, name);
});
procList.getMap().entrySet().stream()
- .filter(e -> !e.getKey().equals("step") && !e.getKey().equals("kamelet"))
+ .filter(e -> !e.getKey().equals("step") )
.forEach((s) -> {
String name = camelize(s.getKey(), "-");
String className = classNameFromRef(procList.getJsonObject(s.getKey()).getString("$ref"));
@@ -376,7 +376,9 @@ public final class CamelModelGenerator {
Set<String> keys = new HashSet<>();
properties.getMap().forEach((s, o) -> {
String propName = deCapitalize(camelize(s, "-"));
- if (!keys.contains(propName) && !(name.equalsIgnoreCase("Choice") && propName.equals("steps"))) {
+ boolean notStepsForChoice = !(name.equalsIgnoreCase("Choice") && propName.equals("steps"));
+ boolean notStepsForKamelet = !(name.equalsIgnoreCase("Kamelet") && propName.equals("steps"));
+ if (!keys.contains(propName) && notStepsForChoice && notStepsForKamelet) {
String type = properties.getJsonObject(s).getString("type");
String ref = properties.getJsonObject(s).getString("$ref");
if (type != null) {
diff --git a/karavan-generator/src/main/resources/camel-yaml-dsl.json b/karavan-generator/src/main/resources/camel-yaml-dsl.json
index 9a51995..47f34cf 100644
--- a/karavan-generator/src/main/resources/camel-yaml-dsl.json
+++ b/karavan-generator/src/main/resources/camel-yaml-dsl.json
@@ -17,24 +17,39 @@
"do-catch" : {
"$ref" : "#/items/definitions/org.apache.camel.model.CatchDefinition"
},
+ "doCatch" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.CatchDefinition"
+ },
"choice" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ChoiceDefinition"
},
"circuit-breaker" : {
"$ref" : "#/items/definitions/org.apache.camel.model.CircuitBreakerDefinition"
},
+ "circuitBreaker" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.CircuitBreakerDefinition"
+ },
"claim-check" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ClaimCheckDefinition"
},
+ "claimCheck" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.ClaimCheckDefinition"
+ },
"convert-body-to" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ConvertBodyDefinition"
},
+ "convertBodyTo" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.ConvertBodyDefinition"
+ },
"delay" : {
"$ref" : "#/items/definitions/org.apache.camel.model.DelayDefinition"
},
"dynamic-router" : {
"$ref" : "#/items/definitions/org.apache.camel.model.DynamicRouterDefinition"
},
+ "dynamicRouter" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.DynamicRouterDefinition"
+ },
"enrich" : {
"$ref" : "#/items/definitions/org.apache.camel.model.EnrichDefinition"
},
@@ -44,30 +59,51 @@
"do-finally" : {
"$ref" : "#/items/definitions/org.apache.camel.model.FinallyDefinition"
},
+ "doFinally" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.FinallyDefinition"
+ },
"idempotent-consumer" : {
"$ref" : "#/items/definitions/org.apache.camel.model.IdempotentConsumerDefinition"
},
+ "idempotentConsumer" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.IdempotentConsumerDefinition"
+ },
"in-only" : {
"$ref" : "#/items/definitions/org.apache.camel.model.InOnlyDefinition"
},
+ "inOnly" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.InOnlyDefinition"
+ },
"in-out" : {
"$ref" : "#/items/definitions/org.apache.camel.model.InOutDefinition"
},
+ "inOut" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.InOutDefinition"
+ },
"intercept" : {
"$ref" : "#/items/definitions/org.apache.camel.model.InterceptDefinition"
},
"intercept-from" : {
"$ref" : "#/items/definitions/org.apache.camel.model.InterceptFromDefinition"
},
+ "interceptFrom" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.InterceptFromDefinition"
+ },
"intercept-send-to-endpoint" : {
"$ref" : "#/items/definitions/org.apache.camel.model.InterceptSendToEndpointDefinition"
},
+ "interceptSendToEndpoint" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.InterceptSendToEndpointDefinition"
+ },
"kamelet" : {
"$ref" : "#/items/definitions/org.apache.camel.model.KameletDefinition"
},
"load-balance" : {
"$ref" : "#/items/definitions/org.apache.camel.model.LoadBalanceDefinition"
},
+ "loadBalance" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.LoadBalanceDefinition"
+ },
"log" : {
"$ref" : "#/items/definitions/org.apache.camel.model.LogDefinition"
},
@@ -83,9 +119,15 @@
"on-completion" : {
"$ref" : "#/items/definitions/org.apache.camel.model.OnCompletionDefinition"
},
+ "onCompletion" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.OnCompletionDefinition"
+ },
"on-fallback" : {
"$ref" : "#/items/definitions/org.apache.camel.model.OnFallbackDefinition"
},
+ "onFallback" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.OnFallbackDefinition"
+ },
"otherwise" : {
"$ref" : "#/items/definitions/org.apache.camel.model.OtherwiseDefinition"
},
@@ -98,24 +140,42 @@
"poll-enrich" : {
"$ref" : "#/items/definitions/org.apache.camel.model.PollEnrichDefinition"
},
+ "pollEnrich" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.PollEnrichDefinition"
+ },
"process" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ProcessDefinition"
},
"recipient-list" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RecipientListDefinition"
},
+ "recipientList" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RecipientListDefinition"
+ },
"remove-header" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RemoveHeaderDefinition"
},
+ "removeHeader" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemoveHeaderDefinition"
+ },
"remove-headers" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RemoveHeadersDefinition"
},
+ "removeHeaders" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemoveHeadersDefinition"
+ },
"remove-properties" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RemovePropertiesDefinition"
},
+ "removeProperties" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemovePropertiesDefinition"
+ },
"remove-property" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RemovePropertyDefinition"
},
+ "removeProperty" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RemovePropertyDefinition"
+ },
"resequence" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ResequenceDefinition"
},
@@ -125,6 +185,9 @@
"routing-slip" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RoutingSlipDefinition"
},
+ "routingSlip" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RoutingSlipDefinition"
+ },
"saga" : {
"$ref" : "#/items/definitions/org.apache.camel.model.SagaDefinition"
},
@@ -137,15 +200,27 @@
"set-body" : {
"$ref" : "#/items/definitions/org.apache.camel.model.SetBodyDefinition"
},
+ "setBody" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SetBodyDefinition"
+ },
"set-exchange-pattern" : {
"$ref" : "#/items/definitions/org.apache.camel.model.SetExchangePatternDefinition"
},
+ "setExchangePattern" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SetExchangePatternDefinition"
+ },
"set-header" : {
"$ref" : "#/items/definitions/org.apache.camel.model.SetHeaderDefinition"
},
+ "setHeader" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SetHeaderDefinition"
+ },
"set-property" : {
"$ref" : "#/items/definitions/org.apache.camel.model.SetPropertyDefinition"
},
+ "setProperty" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.SetPropertyDefinition"
+ },
"sort" : {
"$ref" : "#/items/definitions/org.apache.camel.model.SortDefinition"
},
@@ -167,12 +242,18 @@
"throw-exception" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ThrowExceptionDefinition"
},
+ "throwException" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.ThrowExceptionDefinition"
+ },
"to" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ToDefinition"
},
"to-d" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ToDynamicDefinition"
},
+ "toD" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.ToDynamicDefinition"
+ },
"tod" : {
"$ref" : "#/items/definitions/org.apache.camel.model.ToDynamicDefinition"
},
@@ -185,6 +266,9 @@
"do-try" : {
"$ref" : "#/items/definitions/org.apache.camel.model.TryDefinition"
},
+ "doTry" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.TryDefinition"
+ },
"unmarshal" : {
"$ref" : "#/items/definitions/org.apache.camel.model.UnmarshalDefinition"
},
@@ -197,11 +281,20 @@
"when-skip-send-to-endpoint" : {
"$ref" : "#/items/definitions/org.apache.camel.model.WhenSkipSendToEndpointDefinition"
},
+ "whenSkipSendToEndpoint" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.WhenSkipSendToEndpointDefinition"
+ },
"wire-tap" : {
"$ref" : "#/items/definitions/org.apache.camel.model.WireTapDefinition"
},
+ "wireTap" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.WireTapDefinition"
+ },
"service-call" : {
"$ref" : "#/items/definitions/org.apache.camel.model.cloud.ServiceCallDefinition"
+ },
+ "serviceCall" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.cloud.ServiceCallDefinition"
}
}
},
@@ -842,8 +935,7 @@
}
}
},
- "org.apache.camel.model.FromDefinition" :
- {
+ "org.apache.camel.model.FromDefinition" : {
"oneOf" : [ {
"type" : "string"
}, {
@@ -5301,6 +5393,9 @@
"id" : {
"type" : "string"
},
+ "result-type" : {
+ "type" : "string"
+ },
"trim" : {
"type" : "boolean"
}
@@ -7232,6 +7327,9 @@
"error-handler" : {
"$ref" : "#/items/definitions/org.apache.camel.builder.ErrorHandlerBuilderRef"
},
+ "errorHandler" : {
+ "$ref" : "#/items/definitions/org.apache.camel.builder.ErrorHandlerBuilderRef"
+ },
"beans" : {
"$ref" : "#/items/definitions/org.apache.camel.dsl.yaml.deserializers.BeansDeserializer"
},
@@ -7241,12 +7339,18 @@
"on-exception" : {
"$ref" : "#/items/definitions/org.apache.camel.model.OnExceptionDefinition"
},
+ "onException" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.OnExceptionDefinition"
+ },
"route" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RouteDefinition"
},
"route-template" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RouteTemplateDefinition"
},
+ "routeTemplate" : {
+ "$ref" : "#/items/definitions/org.apache.camel.model.RouteTemplateDefinition"
+ },
"template" : {
"$ref" : "#/items/definitions/org.apache.camel.model.RouteTemplateDefinition"
},