在droll上制定规则以检查子数据

时间:2019-02-04 21:40:17

标签: drools jbpm

我有一个包裹。包裹包括项目清单。项目具有字段列表。我需要检查特定字段是否设置为包装中所有项目的正确值:

UPDATE topics
SET forum_id= 1069
WHERE forum_id > 1400
  AND forum_id NOT IN (3761,3762,3962,3749,2909,1917,1919,1891,3056,1415,4690,1427,1428,3677,3809,1425,1426,4465,4466,3810,1534,1535,1413,4402,3808,1453,1459)

如何获取按子字段过滤的集合?

1 个答案:

答案 0 :(得分:0)

需要使用累积功能:

List( size == pkg.items.size() ) from accumulate (
    $a: itemData( $field1: fields,  $field2: fields ) from pkg.items
    and
    fieldData( fieldId == "111" , value == "1" ) from $field1
    and
    fieldData( fieldId == "222" , value == "2" ) from $field2;
    collectList( $a )
)