Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created 07-29-2019 10:51 AM
I'am struggling with Expression Language concerning nested and-/or-conditions.
In my UpdateAttribute the variable KONTO_IST_AN should be getting the result in boolean which is provided by this expression.
Sample content of RESPONSE (always exactly one element at one time):
[{"antauschbis":"20191231","antauschvon":"20190101","id":"(422)"}] => expected result: true
[{"antauschbis":null,"antauschvon":"20190101","id":"(422)"}] => expected result: true
[{"antauschbis":"20190531","antauschvon":"20190101","id":"(422)"}] => expected result: false
[{"antauschbis":null,"antauschvon":"20200101","id":"(422)"}] => expected result: falseExpression:
${RESPONSE:jsonPath('$.[0].id'):equals(${KONTO_BV}):
and(${RESPONSE:jsonPath('$.[0].antauschvon'):le(${now():format("yyyyMMdd")}):
and(${RESPONSE:jsonPath('$.[0].antauschbis'):ge(${now():format("yyyyMMdd")}):
or(
${RESPONSE:jsonPath('$.[0].antauschbis'):isEmpty()})}
)
)
}But there seems to by a syntax error because the attribute KONTO_IST_AN contains after execution of UpdateAttribute the above expression not the expected result.
Checked all square and round brackets and can't finde my error.
Could someone please tell me how to resolve this?
Created 07-29-2019 12:32 PM
Got it! There was one } missing. Thought if the editor shows the expression coloured it would by syntactical correct.
So it has to be:
${RESPONSE:jsonPath('$.[0].id'):equals(${KONTO_BV}):
and(${RESPONSE:jsonPath('$.[0].antauschvon'):le(${now():format("yyyyMMdd")}):
and(${RESPONSE:jsonPath('$.[0].antauschbis'):ge(${now():format("yyyyMMdd")}):
or(
${RESPONSE:jsonPath('$.[0].antauschbis'):isEmpty()})}
)}
)
}
Created 07-29-2019 12:32 PM
Got it! There was one } missing. Thought if the editor shows the expression coloured it would by syntactical correct.
So it has to be:
${RESPONSE:jsonPath('$.[0].id'):equals(${KONTO_BV}):
and(${RESPONSE:jsonPath('$.[0].antauschvon'):le(${now():format("yyyyMMdd")}):
and(${RESPONSE:jsonPath('$.[0].antauschbis'):ge(${now():format("yyyyMMdd")}):
or(
${RESPONSE:jsonPath('$.[0].antauschbis'):isEmpty()})}
)}
)
}