Reputation: 373
I am Trying to Use a Java component which has 3 string parameters,
I believe to get the reflection entry point resolver to work for this I need to set the payload to be an array of 3 strings however I am struggling to find how to do this,
Any help would be appreciated.
thanks
I am wanting to pass in an xml template file location, xml xpath and new value for the node which the xpath is returning(these will be Hardcoded as array items of the payload(I assume this is the correct approach but I cannot see how to do this)):
public class XMLParserWithParameters
{
public static Object parse2(String TemplatePath, String XPathQuery, String NewValue) throws Exception
{
Upvotes: 0
Views: 6403
Reputation: 1
If you are trying to set Array of String as Payload simply this should work
Upvotes: 0
Reputation: 33413
No need to create an array, just call the static method from MEL:
#[your.package.XMLParserWithParameters.parse2('a','b','c')]
Upvotes: 2
Reputation: 6657
From your post I guess you are looking for a way to set a String array as payload in the config file.
Try the following way
<set-payload value="#[new String[]{"String1" , "String2", "String3"}]"></set-payload>
Or You can also try the following way.
<expression-transformer>
<return-argument expression="new String("Test")" />
<return-argument expression="new String("Test3")" />
<return-argument expression="new String("Test5")" />
</expression-transformer>
In the expression you can use any of the Mule Expressioin Landuage expression.
Hope this helps.
Upvotes: 1
Reputation: 373
I have found that this can be achieved using an expression transformer by setting multiple return values which will create an array of strings.
Upvotes: 0