Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

wso2esb - Transform Payload values based on a lookup table in WSO2 ESB

I wish to transform my JSON Payload based on a set of lookup values in WSO2 ESB.

e.g.

input


[
{
 "name" : "Apple",
 "type" : "fruit"
},
{
 "name" : "Cabbage",
 "type" : "fruit"
},
{
 "name" : "Rice",
 "type" : "grains"
}
]

Expected Output


[
{
 "name" : "Apple",
 "type" : "perishable"
},
{
 "name" : "Cabbage",
 "type" : "perishable"
},
{
 "name" : "Rice",
 "type" : "non-perishable"
}
]

Lookup Table for transformation.

{
"fruits": "perishable"
"grains": "non-perishable"
}

I have tried looking into DataMapper mediator but that does not support as far as I understand.

How to achieve this type of transformation? Kindly help me with this.

question from:https://stackoverflow.com/questions/66064373/transform-payload-values-based-on-a-lookup-table-in-wso2-esb

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...