use of com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_TRANSFORM_NAMESPACE in project mule-migration-assistant by mulesoft.
the class AbstractThrottlingMigrationStep method addOnErrorPropagateElement.
protected void addOnErrorPropagateElement(Element errorHandlerElement) {
List<Element> onErrorPropagateElements = errorHandlerElement.getChildren(ON_ERROR_PROPAGATE_TAG_NAME, MULE_4_CORE_NAMESPACE_NO_PREFIX);
Element onErrorPropagateElement = getOnErrorPropagateElement();
if (onErrorPropagateElements.stream().filter(e -> {
Element addHeadersChildElement = e.getChild(ADD_HEADERS_TAG_NAME, HTTP_TRANSFORM_NAMESPACE);
return e.getContentSize() == onErrorPropagateElement.getContentSize() && addHeadersChildElement != null && matchesAddHeadersElement(addHeadersChildElement, onErrorPropagateElement.getChild(ADD_HEADERS_TAG_NAME, HTTP_TRANSFORM_NAMESPACE));
}).findAny().orElse(null) == null) {
errorHandlerElement.addContent(onErrorPropagateElement);
}
}
use of com.mulesoft.tools.migration.library.gateway.steps.GatewayNamespaces.HTTP_TRANSFORM_NAMESPACE in project mule-migration-assistant by mulesoft.
the class ValidateClientProcessorChainTagMigrationStep method migrateContent.
@Override
protected void migrateContent(Element errorHandlerElement, List<Content> cloneContentList) {
Element onErrorContinueElement = new ClientIdEnforcementOnErrorContinueElementWriter().create(errorHandlerElement, false);
onErrorContinueElement.addContent(0, cloneContentList);
replaceSetPayloadElement(onErrorContinueElement.getChildren(SET_PAYLOAD_TAG_NAME, MULE_4_POLICY_NAMESPACE).stream().filter(e -> {
String attrValue = e.getAttributeValue(VALUE_ATTR_NAME);
return attrValue.equals(VALUE_FLOW_VARS) || attrValue.equals(VALUE_VARS);
}).findFirst().orElse(null));
com.mulesoft.tools.migration.library.mule.steps.http.HttpConnectorListener.httpListenerLib(getApplicationModel());
addNamespaceDeclaration(getRootElement(onErrorContinueElement), HTTP_TRANSFORM_NAMESPACE, HTTP_TRANSFORM_XSI_SCHEMA_LOCATION_URI_MULE4);
}
Aggregations