I have created a sample mule application that fetches one row from my database. It fetches USER_NAME and USER_ID from the Database. when I convert the result to JSON or XML I get the output as
[{"USER_ID":"U001","USER_NAME":"Dharmin"}]
Now i want to save USER_ID and USER_NAME in Session variables. Can someone guide me ?
edit: updated the basic flow image




After converting to JSON Add this :-
<json:json-to-object-transformer returnClass="java.util.HashMap" doc:name="JSON to Object"/>and after that put the value into session variable using the following :-
and
<set-session-variable doc:name="Session Variable" value="message.payload.USER_NAME" variableName="USER_NAME"/>