Skip to content

Multiple Dataweave transform message in same flow should produce multiple transform class #118

@sanagaraj-pivotal

Description

@sanagaraj-pivotal

Describe the bug
A flow with a Dataweave transformation will result in creation of a transformation class whose name is dependent on flow name.
When a flow contains multiple dataweave transformation, it should produce multiple classes, right now it is producing only one class for multiple dataweave transformations.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a java template project example here
  2. create a new file in resources folder called multipletransform.xml
  3. paste the below content for multipletransform.xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/db http://www.mulesoft.org/schema/mule/db/current/mule-db.xsd
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd">
    <flow name="multipleTransforms">
        <dw:transform-message doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/json indent = true, skipNullOn = "everywhere"
---
{
	"hello": {
		"world": {
			"hello": "indeed!",
		},
	}
}]]></dw:set-payload>
        </dw:transform-message>
        <logger />
        <dw:transform-message doc:name="Build Response Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/json indent = true, skipNullOn = "everywhere"
---
{
	"responseBody": {
		"responseInfo": {
			"responseStatus": "200"
		},
	}
}]]></dw:set-payload>
        </dw:transform-message>
    </flow>
</mule>

  1. Run spring boot migrator and apply mule-to-boot recipe.
  2. You will see only one transform file called MultipleTransformsTransform

Expected behavior
Since there are two DWL transforms, this should produce two distinct transform files, may be MultipleTransformsTransform_1 and MultipleTransformsTransform_2

Screenshots
image

Metadata

Metadata

Labels

type: bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions