Can't get Basic filter expression with logical operator to work

0

Can't get Basic filter expression with logical operator to work.

These two basic filter expression are working fine:

<field name="letterTypeID9" class="java.lang.Long">
    <propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.ccms.*(typeId==9).createdAt"]]></propertyExpression>
</field>
<field name="letterStateSent" class="java.lang.Long">
    <propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.ccms.*(state==\"SENT\").createdAt"]]></propertyExpression>
</field>

But combined - with logical operator AND (&&) returns 'null':

<field name="letterTypeID9AndStateLetterSent" class="java.lang.Long">
    <propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$.ccms.*(typeId==9 && state==\"SENT\").createdAt"]]></propertyExpression>
</field>

What is going wrong?

The JSON:

{
  ...
  "ccms": [
    {
      "id": 727112,
      "direction": "OUT",
      "channel": "2",
      "typeId": 9,
      "type": "brief",
      "someDate": 1561986176008,
      "lastStateChange": 0,
      "summary": "brief",
      "state": "SENT",
      "system": true,
      "followUpRequired": false,
      "externalRef": "GAS/P/KO/2015/4847",
      "unitId": 4,
      "createdAt": "1561986176011",
      "endDate": null
    },
    {
      "id": 727111,
      "direction": "OUT",
      "channel": "2",
      "typeId": 9,
      "type": "brief",
      "someDate": 1561986135903,
      "lastStateChange": 0,
      "summary": "brief",
      "state": "PREPARED",
      "system": true,
      "followUpRequired": false,
      "externalRef": "GAS/P/KO/2015/4847",
      "unitId": 4,
      "createdAt": "1561986135906",
      "endDate": null
    }
  ]
}

nel__'s picture
2
Joined: Apr 7 2014 - 6:05am
Last seen: 1 month 3 weeks ago

0 Answers:

No answers yet
Feedback
randomness