Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mule: Add ability to access headers during transformation #137

Closed
sanagaraj-pivotal opened this issue May 26, 2022 · 0 comments
Closed

Mule: Add ability to access headers during transformation #137

sanagaraj-pivotal opened this issue May 26, 2022 · 0 comments
Labels

Comments

@sanagaraj-pivotal
Copy link
Contributor

sanagaraj-pivotal commented May 26, 2022

labels: ["in: mule-3.9"]

What needs to be done

Currently, DWL transformations are translated as below

Sample input
        <dw:transform-message doc:name="Transform Message">
            <dw:set-payload><![CDATA[%dw 1.0
%output application/java
---
(flowVars.someVar splitBy ",") map ("'" ++ $ ++ "'") joinBy ","]]></dw:set-payload>
        </dw:transform-message>
Generates following translation/output:
 @Bean
    IntegrationFlow transform() {

        return IntegrationFlows.from(...)
                ... 
               .transform(TransformClass::transform)
                ...
                .get();
    }
class TransformClass {
    /** contents of DWL transformation will be pasted as comments*/
    public static TransformClass transform(Object payload) {
    }
}

If you look at the above TransformClass there is only access to payload not headers

We need provision to access both headers and payload whilst transformation.

Why it needs to be done

In mule transformations, there will be instances where we need to access headers and payload whilst performing translations. This is evident from client applications that we have encountered where this pattern is used prolifically.

Additional Information

Possible solution can be found here.

@fabapp2 fabapp2 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants