-3

Mule : Could you please help following query : In Anypoint Mule IDE, How to assign values to a Payload like this "Value1|Value2|Value3|Value4|.." ? and then assign the payload to Java component in Mule?

I tried following approach: (1) define Java component and return String object as output (by implementing callable method as below):

public class InputToJavaComponent implements Callable {

@Override
public Object onCall(MuleEventContext eventContext) throws Exception {

    return "Value1|Value2|Value3";
}

I was checking if is there any other simple way to achieve same thing.

Thanks.

Ranga
  • 11
  • 4

3 Answers3

0

Can you please try like this in set payload and let us know whether it work or not

[flowVars.Value1+'|']#[flowVars.Value2+'|']#[flowVars.Value3+'|']#[flowVars.Value4]

Community
  • 1
  • 1
  • Thank you Koteswarrao, I will try and update you accordingly, the callable implementation technique works as well, I was planning to try some other technique. – Ranga Jul 15 '16 at 09:24
0

Both approaches as follow works fine: (1)

@Override
public Object onCall(MuleEventContext eventContext) throws Exception {
    return "Value1|Value2|Value3";
}

(2)

[flowVars.Value1+'|']#[flowVars.Value2+'|']#[flowVars.Value3+'|']#[flowVars.Value4]
Michael Gaskill
  • 7,913
  • 10
  • 38
  • 43
Ranga
  • 11
  • 4
0

hi i tried as the below way and it was working fine for me, try in this way

[sessionVars.Value1+'|']#[sessionVars.Value2+'|']#[sessionVars.Value3+'|']#[sessionVars.Value4]

Community
  • 1
  • 1