cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Router expressions - Need help!

kiranm
New Contributor II

I need to apply the routing conditions, and based on the matching criteria I have to call SOAP update, create methods:

Criteria 1: ($employee *.empId exists in $employees) && ($employee *.empId == $excelEmp *.empId)
then take $excelEmp and call Update SOAP

Criteria 2: ($excelEmp *.empId exists in $employees) && ($excelEmp *.empId != $excelEmp *.empId)
then take $excelEmp and call Create SOAP

Please help in writing the Router expressions for the above criteria

image

The below is the json:
[
{
โ€œemployeeโ€: {
โ€œempIdโ€: โ€œ999โ€,
โ€œageโ€: โ€œ45โ€,
โ€œsalHikeโ€: โ€œ15โ€,
โ€œdepIdโ€: โ€œ285898โ€,
โ€œguidโ€: โ€œABCโ€
}
},
{
โ€œemployeeโ€: {
โ€œempIdโ€: โ€œ1000โ€,
โ€œageโ€: โ€œ45โ€,
โ€œsalHikeโ€: โ€œ15โ€,
โ€œdepIdโ€: โ€œ285898โ€,
โ€œguidโ€: โ€œPQRโ€
}
},
{
โ€œemployeeโ€: {
โ€œempIdโ€: โ€œ1001โ€,
โ€œageโ€: โ€œ45โ€,
โ€œsalHikeโ€: โ€œ10โ€,
โ€œdepIdโ€: โ€œ285898โ€,
โ€œguidโ€: โ€œXYZโ€
}
},
{
โ€œemployeesโ€: [
โ€œ1000โ€,
โ€œ1001โ€,
โ€œ1002โ€,
โ€œ1003โ€,
โ€œ1004โ€,
โ€œ1005โ€,
โ€œ1006โ€
]
},
{
โ€œexcelEmpโ€: {
โ€œempIdโ€: โ€œ1001โ€,
โ€œcurrencyโ€: โ€œINRโ€,
โ€œnewHikeโ€: โ€œ8โ€,
โ€œvarPayโ€: โ€œ90โ€
}
},
{
โ€œexcelEmpโ€: {
โ€œempIdโ€: โ€œ1002โ€,
โ€œcurrencyโ€: โ€œINRโ€,
โ€œnewHikeโ€: โ€œ5โ€,
โ€œvarPayโ€: โ€œ60โ€
}
},
{
โ€œexcelEmpโ€: {
โ€œempIdโ€: โ€œ1005โ€,
โ€œcurrencyโ€: โ€œINRโ€,
โ€œnewHikeโ€: โ€œ6โ€,
โ€œvarPayโ€: โ€œ90โ€
}
},
{
โ€œexcelEmpโ€: {
โ€œempIdโ€: โ€œ1006โ€,
โ€œcurrencyโ€: โ€œINRโ€,
โ€œnewHikeโ€: โ€œ6โ€,
โ€œvarPayโ€: โ€œ90โ€
}
}
]

2 REPLIES 2

anubhav_nautiya
Contributor

could you please attach the slp file having Json Generator, tried to copy the JSON but it fails while validating.

Hi Anubhav,
Please find the slp file attached
Router-conditions_2020_05_11.slp (15.0 KB)