Closed kimnamcham closed 1 year ago
Input data string for test on web: {"loan":{"requestInfo":{"requestLoanAmount":10000000},"queueName":"PTF_Credit_Approval"},"user":{"level":1}}
Your data is incorrect, you need to do something like this:
Map<String, Object> data = new HashMap<>();
Map<String, Object> loan = new HashMap<>();
Map<String, Object> requestInfo = new HashMap<>();
Map<String, Object> user = new HashMap<>();
data.put("loan", loan);
data.put("user", user);
loan.put("requestInfo", requestInfo);
loan.put("queueName", "PTF_Credit_Approval");
requestInfo.put("requestLoanAmount", 10000000);
Then you can pass data
to json-logic-java.
Hi, i have json logic with var nested object, how to compute input data with nested object
JsonLogic:
String expression = "{\"and\":[{\">=\":[{\"var\":\"loan.requestInfo.requestLoanAmount\"},10000000]},{\">=\":[{\"var\":\"user.level\"},1]},{\"==\":[{\"var\":\"loan.queueName\"},\"PTF_Credit_Approval\"]}]}";
Input Data:
Map<String, Object> data = new HashMap<>(); data.put("loan.requestInfo.requestLoanAmount", 10000000); data.put("loan.queueName", "PTF_Credit_Approval"); data.put("user.level", 1);
I have test on this web: https://jsonlogic.com/play.html, input data with result true . But when check with this library, it's always return false. How to resolve this issuse, thanks?