Search in sources :

Example 1 with TargetModelProperty

use of org.mule.runtime.extension.internal.property.TargetModelProperty in project mule by mulesoft.

the class MuleExtensionModelDeclarer method declareSplitAggregate.

private void declareSplitAggregate(ExtensionDeclarer extensionDeclarer, ClassTypeLoader typeLoader) {
    ConstructDeclarer splitAggregate = extensionDeclarer.withConstruct("splitAggregate").describedAs("Splits the same message and processes each part in parallel.").withErrorModel(compositeRoutingError);
    splitAggregate.withChain();
    splitAggregate.onDefaultParameterGroup().withOptionalParameter("collection").ofType(typeLoader.load(String.class)).withRole(ParameterRole.BEHAVIOUR).withExpressionSupport(REQUIRED).describedAs("Expression that defines the collection of parts to be processed in parallel");
    splitAggregate.onDefaultParameterGroup().withOptionalParameter("timeout").ofType(typeLoader.load(Long.class)).defaultingTo(Long.MAX_VALUE).withExpressionSupport(NOT_SUPPORTED).describedAs("Sets a timeout in milliseconds for each route. Values lower or equals than zero means no timeout.");
    splitAggregate.onDefaultParameterGroup().withOptionalParameter("maxConcurrency").ofType(typeLoader.load(Integer.class)).defaultingTo(Integer.MAX_VALUE).withExpressionSupport(NOT_SUPPORTED).describedAs("This value determines the maximum level of parallelism that will be used by this router.");
    splitAggregate.onDefaultParameterGroup().withOptionalParameter(TARGET_PARAMETER_NAME).ofType(typeLoader.load(String.class)).withExpressionSupport(NOT_SUPPORTED).describedAs(TARGET_PARAMETER_DESCRIPTION).withLayout(LayoutModel.builder().tabName(ADVANCED_TAB).build());
    splitAggregate.onDefaultParameterGroup().withOptionalParameter(TARGET_VALUE_PARAMETER_NAME).ofType(typeLoader.load(String.class)).defaultingTo(PAYLOAD).withExpressionSupport(REQUIRED).describedAs(TARGET_VALUE_PARAMETER_DESCRIPTION).withRole(BEHAVIOUR).withDisplayModel(DisplayModel.builder().displayName(TARGET_VALUE_PARAMETER_DISPLAY_NAME).build()).withLayout(LayoutModel.builder().tabName(ADVANCED_TAB).build()).withModelProperty(new TargetModelProperty());
}
Also used : ConstructDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ConstructDeclarer) TargetModelProperty(org.mule.runtime.extension.internal.property.TargetModelProperty)

Example 2 with TargetModelProperty

use of org.mule.runtime.extension.internal.property.TargetModelProperty in project mule by mulesoft.

the class MuleExtensionModelDeclarer method declareScatterGather.

private void declareScatterGather(ExtensionDeclarer extensionDeclarer, ClassTypeLoader typeLoader) {
    ConstructDeclarer scatterGather = extensionDeclarer.withConstruct("scatterGather").describedAs("Sends the same message to multiple message processors in parallel.").withErrorModel(compositeRoutingError);
    scatterGather.withRoute("route").withMinOccurs(2).withChain();
    scatterGather.onDefaultParameterGroup().withOptionalParameter("timeout").ofType(typeLoader.load(Long.class)).defaultingTo(Long.MAX_VALUE).withExpressionSupport(NOT_SUPPORTED).describedAs("Sets a timeout in milliseconds for each route. Values lower or equals than zero means no timeout.");
    scatterGather.onDefaultParameterGroup().withOptionalParameter("maxConcurrency").ofType(typeLoader.load(Integer.class)).defaultingTo(Integer.MAX_VALUE).withExpressionSupport(NOT_SUPPORTED).describedAs("This value determines the maximum level of parallelism that will be used by this router.");
    scatterGather.onDefaultParameterGroup().withOptionalParameter(TARGET_PARAMETER_NAME).ofType(typeLoader.load(String.class)).withExpressionSupport(NOT_SUPPORTED).describedAs(TARGET_PARAMETER_DESCRIPTION).withLayout(LayoutModel.builder().tabName(ADVANCED_TAB).build());
    scatterGather.onDefaultParameterGroup().withOptionalParameter(TARGET_VALUE_PARAMETER_NAME).ofType(typeLoader.load(String.class)).defaultingTo(PAYLOAD).withExpressionSupport(REQUIRED).describedAs(TARGET_VALUE_PARAMETER_DESCRIPTION).withRole(BEHAVIOUR).withDisplayModel(DisplayModel.builder().displayName(TARGET_VALUE_PARAMETER_DISPLAY_NAME).build()).withLayout(LayoutModel.builder().tabName(ADVANCED_TAB).build()).withModelProperty(new TargetModelProperty());
// TODO MULE-13316 Define error model (Routers should be able to define error type(s) thrown in ModelDeclarer but
// ConstructModel doesn't support it.)
}
Also used : ConstructDeclarer(org.mule.runtime.api.meta.model.declaration.fluent.ConstructDeclarer) TargetModelProperty(org.mule.runtime.extension.internal.property.TargetModelProperty)

Aggregations

ConstructDeclarer (org.mule.runtime.api.meta.model.declaration.fluent.ConstructDeclarer)2 TargetModelProperty (org.mule.runtime.extension.internal.property.TargetModelProperty)2