我有两个事实要插入到我的流口水会话中。我想检查以下内容:
(shipment1 != null && shipping1.shipToCustomerNo == waypoint1.shipToNumber) || 装运1 == null
如何在基于 web 的 guvnor 决策表中添加此条件?我尝试过使用谓词,waypoint1 和 shipping1 是成功插入会话的绑定变量。如果我使用谓词并添加上面的内容,我的测试用例工作正常,但是当我在我的 java 应用程序中实际运行这些规则时,即使数据是等价的,条件也永远不会评估为真。我尝试了许多不同的方法来构造这个查询。下面是生成的源码:
//from row number: 1
rule "Row 1 Arrive Destination"
salience 3
activation-group "arrive-destination"
dialect "mvel"
when
waypoint1 : Waypoint( type == "Destination" )
clm1 : CarLocationMessage( sightCode == "Z" , loaded == true )
shipment1 : Shipment( eval( (shipment1 != null && shipment1.shipToCustomerNo == waypoint1.shipToNumber) || shipment1 == null ))
then
TripEventRuleResult tripEventRuleResult1 = new TripEventRuleResult();
tripEventRuleResult1.setEventType( "Arrive" );
insert( tripEventRuleResult1 );
end