Search in sources :

Example 1 with MULE_ABSTRACT_MESSAGE_SOURCE_TYPE

use of org.mule.runtime.config.internal.dsl.SchemaConstants.MULE_ABSTRACT_MESSAGE_SOURCE_TYPE in project mule by mulesoft.

the class SourceSchemaDelegate method registerSourceType.

private void registerSourceType(String name, SourceModel sourceModel, DslElementSyntax dslSyntax, boolean hasImplicitConfig) {
    final ExtensionType sourceType = createExecutableType(name, MULE_ABSTRACT_MESSAGE_SOURCE_TYPE, dslSyntax, hasImplicitConfig);
    initialiseSequence(sourceType);
    ExplicitGroup sequence = sourceType.getSequence();
    builder.addInfrastructureParameters(sourceType, sourceModel, sequence);
    List<ParameterModel> visitedParameters = new LinkedList<>();
    sourceModel.getParameterGroupModels().forEach(group -> {
        registerParameterGroup(sourceType, group);
        visitedParameters.addAll(group.getParameterModels());
    });
    sourceModel.getSuccessCallback().map(ParameterizedModel::getParameterGroupModels).ifPresent(groups -> groups.forEach(group -> registerCallbackParameters(sourceType, visitedParameters, group)));
    sourceModel.getErrorCallback().map(ParameterizedModel::getParameterGroupModels).ifPresent(groups -> groups.forEach(group -> registerCallbackParameters(sourceType, visitedParameters, group)));
}
Also used : TYPE_SUFFIX(org.mule.runtime.config.internal.dsl.SchemaConstants.TYPE_SUFFIX) ParameterModel(org.mule.runtime.api.meta.model.parameter.ParameterModel) StringUtils.capitalize(org.apache.commons.lang3.StringUtils.capitalize) ParameterizedModel(org.mule.runtime.api.meta.model.parameter.ParameterizedModel) ExplicitGroup(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExplicitGroup) TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) ExtensionType(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExtensionType) Element(org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) SourceModel(org.mule.runtime.api.meta.model.source.SourceModel) MULE_ABSTRACT_MESSAGE_SOURCE(org.mule.runtime.config.internal.dsl.SchemaConstants.MULE_ABSTRACT_MESSAGE_SOURCE) DslElementSyntax(org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax) MULE_ABSTRACT_MESSAGE_SOURCE_TYPE(org.mule.runtime.config.internal.dsl.SchemaConstants.MULE_ABSTRACT_MESSAGE_SOURCE_TYPE) ParameterGroupModel(org.mule.runtime.api.meta.model.parameter.ParameterGroupModel) SOURCE(org.mule.runtime.extension.api.stereotype.MuleStereotypes.SOURCE) QName(javax.xml.namespace.QName) LinkedList(java.util.LinkedList) ParameterModel(org.mule.runtime.api.meta.model.parameter.ParameterModel) ExtensionType(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExtensionType) LinkedList(java.util.LinkedList) ExplicitGroup(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExplicitGroup)

Aggregations

LinkedList (java.util.LinkedList)1 List (java.util.List)1 Collectors.toList (java.util.stream.Collectors.toList)1 QName (javax.xml.namespace.QName)1 StringUtils.capitalize (org.apache.commons.lang3.StringUtils.capitalize)1 ParameterGroupModel (org.mule.runtime.api.meta.model.parameter.ParameterGroupModel)1 ParameterModel (org.mule.runtime.api.meta.model.parameter.ParameterModel)1 ParameterizedModel (org.mule.runtime.api.meta.model.parameter.ParameterizedModel)1 SourceModel (org.mule.runtime.api.meta.model.source.SourceModel)1 MULE_ABSTRACT_MESSAGE_SOURCE (org.mule.runtime.config.internal.dsl.SchemaConstants.MULE_ABSTRACT_MESSAGE_SOURCE)1 MULE_ABSTRACT_MESSAGE_SOURCE_TYPE (org.mule.runtime.config.internal.dsl.SchemaConstants.MULE_ABSTRACT_MESSAGE_SOURCE_TYPE)1 TYPE_SUFFIX (org.mule.runtime.config.internal.dsl.SchemaConstants.TYPE_SUFFIX)1 DslElementSyntax (org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax)1 SOURCE (org.mule.runtime.extension.api.stereotype.MuleStereotypes.SOURCE)1 Element (org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element)1 ExplicitGroup (org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExplicitGroup)1 ExtensionType (org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExtensionType)1 TopLevelElement (org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement)1