Skip to content

Commit

Permalink
feat(RouteConfiguration): Add support for RouteConfiguration entity
Browse files Browse the repository at this point in the history
This commit adds support for RouteConfiguration entity.

In detail, the following entities were added:
* intercept
* interceptFrom
* interceptSendToEndpoint
* onCompletion

Also the nested version of said entities were added

fix: #492
  • Loading branch information
lordrip committed Apr 16, 2024
1 parent 33e03dd commit 8e5830b
Show file tree
Hide file tree
Showing 20 changed files with 1,699 additions and 227 deletions.
10 changes: 10 additions & 0 deletions packages/ui/src/models/camel/camel-route-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ import { createCamelPropertiesSorter, isDefined } from '../../utils';
import { AddStepMode } from '../visualization/base-visual-entity';
import { CamelRouteVisualEntity, isCamelFrom, isCamelRoute } from '../visualization/flows';
import { CamelErrorHandlerVisualEntity } from '../visualization/flows/camel-error-handler-visual-entity';
import { CamelInterceptFromVisualEntity } from '../visualization/flows/camel-intercept-from-visual-entity';
import { CamelInterceptSendToEndpointVisualEntity } from '../visualization/flows/camel-intercept-send-to-endpoint-visual-entity';
import { CamelInterceptVisualEntity } from '../visualization/flows/camel-intercept-visual-entity';
import { CamelOnCompletionVisualEntity } from '../visualization/flows/camel-on-completion-visual-entity';
import { CamelOnExceptionVisualEntity } from '../visualization/flows/camel-on-exception-visual-entity';
import { CamelRestConfigurationVisualEntity } from '../visualization/flows/camel-rest-configuration-visual-entity';
import { CamelRouteConfigurationVisualEntity } from '../visualization/flows/camel-route-configuration-visual-entity';
import { NonVisualEntity } from '../visualization/flows/non-visual-entity';
import { CamelComponentFilterService } from '../visualization/flows/support/camel-component-filter.service';
import { CamelRouteVisualEntityData } from '../visualization/flows/support/camel-component-types';
Expand All @@ -18,8 +23,13 @@ import { SourceSchemaType } from './source-schema-type';
export class CamelRouteResource implements CamelResource, BeansAwareResource {
static readonly SUPPORTED_ENTITIES = [
CamelOnExceptionVisualEntity,
CamelOnCompletionVisualEntity,
CamelErrorHandlerVisualEntity,
CamelRestConfigurationVisualEntity,
CamelRouteConfigurationVisualEntity,
CamelInterceptVisualEntity,
CamelInterceptFromVisualEntity,
CamelInterceptSendToEndpointVisualEntity,
] as const;
static readonly PARAMETERS_ORDER = ['id', 'description', 'uri', 'parameters', 'steps'];
readonly sortFn = createCamelPropertiesSorter(CamelRouteResource.PARAMETERS_ORDER) as (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -32,7 +32,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -44,7 +44,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -68,7 +68,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand All @@ -80,7 +80,7 @@ exports[`AbstractCamelVisualEntity getNodeInteraction should return the correct
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
"canReplaceStep": false,
}
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{
processorName: 'interceptSendToEndpoint',
path: 'interceptSendToEndpoint'
}' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'from', path: 'from' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'intercept', path: 'intercept' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'interceptFrom', path: 'interceptFrom' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": true,
"canRemoveStep": false,
"canReplaceStep": false,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'log', path: 'log' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onCompletion', path: 'onCompletion' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onException', path: 'onException' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'route', path: 'route' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'to', path: 'to' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptFromVisualEntity should serialize the entity 1`] = `
{
"interceptFrom": {
"id": "interceptFrom-1234",
"uri": "direct:a-reference",
},
}
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{
processorName: 'interceptSendToEndpoint',
path: 'interceptSendToEndpoint'
}' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": true,
"canRemoveStep": false,
"canReplaceStep": false,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'from', path: 'from' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'intercept', path: 'intercept' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'interceptFrom', path: 'interceptFrom' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'log', path: 'log' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onCompletion', path: 'onCompletion' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'onException', path: 'onException' }' processor 1`] = `
{
"canHaveChildren": true,
"canHaveNextStep": false,
"canHavePreviousStep": false,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'route', path: 'route' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity getNodeInteraction should return the correct interaction for the '{ processorName: 'to', path: 'to' }' processor 1`] = `
{
"canHaveChildren": false,
"canHaveNextStep": true,
"canHavePreviousStep": true,
"canHaveSpecialChildren": false,
"canRemoveFlow": false,
"canRemoveStep": true,
"canReplaceStep": true,
}
`;

exports[`CamelInterceptSendToEndpointVisualEntity should serialize the entity 1`] = `
{
"interceptSendToEndpoint": {
"id": "interceptSendToEndpoint-1234",
"uri": "direct:a-reference",
},
}
`;
Loading

0 comments on commit 8e5830b

Please sign in to comment.