Validation in drools

后端 未结 2 658
终归单人心
终归单人心 2021-01-26 00:05

This is the second part of my drools validation question. First part has been already answered and proposed solutions has been implemented in my code. First Part

This is

相关标签:
2条回答
  • 2021-01-26 00:23

    Added itemValue tests as seen in some comment

    rule "land-orbuilding..."
    when
      Peson( $financeDetails: financeDetails, $personAddress: personAddress )
      FinanceDetails( financeItemName == "Land or Building", itemValue == null || itemValue == 0 ) from $financeDetails
      PersonAddress( status == AddressStatus.CURRENT,
                     type == AddressType.PHYSICAL,
                     useType == AddressUseType.HOME,
                     ownerShipType == "Own" ) from $personAddress
    then
      //...
    end
    

    How about reading some of that documentation? This is very much like the "first part", and only a minor variation.

    0 讨论(0)
  • 2021-01-26 00:27
    rule "Check Details"
    when
      details:FinanceDetails  (itemValue == 'LAND' || == 'Building')
      address:PersonAddress(status == AddressStatus.CURRENT,
                     type == AddressType.PHYSICAL,
                     useType == AddressUseType.HOME,
                     ownerShipType == "Own" )
    then
      modify(details){itemValue=//set your value};
    end
    
    0 讨论(0)
提交回复
热议问题