diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts index f4b86423b..1c5b965cb 100644 --- a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts +++ b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts @@ -37,6 +37,24 @@ describe('CamelComponentDefaultService', () => { expect(doTryDefault.doTry?.doCatch?.[0].exception).toHaveLength(1); }); + it('should return the default value for a otherwise processor', () => { + const otherwiseDefault = CamelComponentDefaultService.getDefaultNodeDefinitionValue({ + type: 'processor', + name: 'otherwise', + } as DefinedComponent) as any; + expect(otherwiseDefault).toBeDefined(); + expect(otherwiseDefault.steps[0].log).toBeDefined(); + }); + + it('should return the default value for a doFinally processor', () => { + const doFinallyDefault = CamelComponentDefaultService.getDefaultNodeDefinitionValue({ + type: 'processor', + name: 'doFinally', + } as DefinedComponent) as any; + expect(doFinallyDefault).toBeDefined(); + expect(doFinallyDefault.steps[0].log).toBeDefined(); + }); + it('should return the default value for a log processor', () => { const logDefault = CamelComponentDefaultService.getDefaultNodeDefinitionValue({ type: 'processor', diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts index 5603e98b8..15131a4c4 100644 --- a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts +++ b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts @@ -126,6 +126,16 @@ export class CamelComponentDefaultService { message: "\${body}" `); + case 'otherwise': + case 'doFinally': + return parse(` + id: ${getCamelRandomId(processorName)} + steps: + - log: + id: ${getCamelRandomId('log')} + message: "\${body}" + `); + case 'log': return parse(` log: