Business logic can be quite complex. Up until now in this chapter, we have seen fairly simple, straightforward IF/THEN rule sets with a limited number of variations. However, it is not hard to imagine more convoluted rules, for situations where multiple dimensions influence the outcome and several options may apply along each dimension. The decision table–style rule set in Oracle Business Rules helps to manage such situations.
The calculation of the airport charge is not as simple as we discussed in the previous section. There is more at stake than just the weight and the type of flight. The formula also takes into account a surcharge for which the calculation depends on the noise category of the aircraft, the timeslot of the flight and whether the flight takes off or touches down. Simply put: for each combination of noise category, time slot and arrival or departure, a different surcharge percentage is determined. The total charge is calculated from the base rate corrected with this surcharge percentage.
In this section, we use a Decision Table style business rule to derive the airport charge, based on the real calculation table from an actual Airport:
In our SOA Composite:
My Fusion Middleware Blog – SOA/BPM Suite 12c: Oracle Business Rules – MS Excel Integration
Oracle Fusion Middleware Blog: SOA Suite 11g Edit DVM and Business Rules at runtime using console
Real world airport charge calculations are discussed for example here: ttp://www.boeing.com/commercial/noise/SchipholChargesConditions1nov11.pdf and here http://www.yvr.ca/en/business-at-yvr/tariffs.aspx
The starting point sources are in the folder AirportCharge_step1. The end result for this section is in the AirportCharge_step2 folder.