spring-boot-migrator icon indicating copy to clipboard operation
spring-boot-migrator copied to clipboard

Remove the application property to toggle TriggerMesh DWL integration

Open fabapp2 opened this issue 3 years ago • 0 comments

What needs to be done

Currently, the support to generate code for TriggerMesh #434 integration when migrating from Mule 3.9 to Spring Boot can be toggled by setting the application property sbm.muleTriggerMeshTransformEnabled.

The behaviour should be changed as this property is more of a recipe/action configuration and should not be on application level.

Why it needs to be done

Instead of using Spring application properties to trigger the behaviour of JavaDslAction2, there should be two variants of the migrate-mule-to-boot recipe, one with TriggerMesh and one without. This would provide a simpler and cleaner user experience to chose different behaviour of a migration.

The problem is that with the current implementation DwlTransformTranslator is configurable to create TriggerMesh or "default" (hints) DWL translation by setting the sbm.muleTriggerMeshTransformEnabled flag. With the current implementation this flag has to be passed through from the recipe declaration to the Translator to remove the need for the application property.

A solution could be:

  • [ ] Remove the application property
  • [ ] Provide a member in JavaDSLAction to keep the strategy (enum) for Dwl translation
  • [ ] Provide two Translators, one for TriggerMesh and one for previous, default DWL translation.
  • [ ] Refactor FlowTopLevelElementFactory.buildDefinition() to allow passing a strategy (replacing the flag) which defines which of the DwlTranslators gets added to the Map<Class, MuleComponentToSpringIntegrationDslTranslator> translatorsMap.
public TopLevelElement buildDefinition(JAXBElement topLevelElement, MuleConfigurations muleConfigurations, DwlTranslationStrategy dwlTranslationStrategy) {
 ...
}

factory.buildDefinition(element, muleConfigurations, DwlTranslationStrategy.TRIGGER_MESH)
  • [ ] Provide the strategy to the buildDefinition method
  • [ ] Move the class creation from JavaDSLAction2 into the TriggerMesh Dwl Transformer

Additional Information

fabapp2 avatar Sep 23 '22 12:09 fabapp2