The Rules module

LF‑ET generates the rules module from the decision table as a class with
-
an 'execute-method' which receives an implementation of the interface as a transfer value
-
an 'IF-ELSE-tree', whose best possible structure (sequence and nesting of conditions) at each generation is completely recomputed
The IF-ELSE-tree works exclusively with the generated interface methods.
7 rules ⇒ 7 program branches
The decision table has 7 rules – the IF-ELSE-tree 7 program branches that exactly match them:
// *** WARNING: DO NOT MODIFY *** This is a generated Java source code!
//
// Generated by LF-ET 2.4.1 (260219a), https://www.lohrfink.de/lfet
// From decision table
// "/src/main/resources/lfet/demo/InvoiceTotal.lfet"
// 24.02.2026 15:20
//
// Prolog Standard ---->
// profile LFET.Java.Prolog.Standard.Interface.Dt.ini not found
// used LF-ET 2.4.1 (260219a) build in default
package lfet.demo;
import javax.annotation.processing.Generated;
@Generated("LF-ET")
public class InvoiceTotal_rulesEngine
{
public void execute(InvoiceTotal_iFace iface)
{
// Prolog Standard <----
if (iface.isPurchaseOrderValue_Less2000())
{
// Rule R01 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 1);
iface.doCalculateShippingCosts();
iface.doInvoiceTotal_Upd();
// Rule R01 <----
}
else if (iface.isPurchaseOrderValue_20007500())
{
if (iface.isDiscount_Greater0())
{
if (iface.isDiscountType_PercentageDiscountOnThePurchaseOrderValue())
{
// Rule R02 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 2);
iface.doApplyDiscount();
iface.doCalculateShippingCosts();
iface.doInvoiceTotal_Upd();
// Rule R02 <----
}
else // Discount type EUR - fixed amount, will be deducted from the purchase order value
{
if (iface.isDiscountLessPurchaseOrderValue())
{
// Rule R03 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 3);
iface.doApplyDiscount();
iface.doCalculateShippingCosts();
iface.doInvoiceTotal_Upd();
// Rule R03 <----
}
else // Discount < Purchase order value N - No
{
// Rule R04 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 4);
iface.doCalculateShippingCosts();
iface.doInvoiceTotal_Upd();
// Rule R04 <----
}
}
}
else // Discount none - no discount given
{
// Rule R05 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 5);
iface.doCalculateShippingCosts();
iface.doInvoiceTotal_Upd();
// Rule R05 <----
}
}
else // Purchase order value > 75.00 - high
{
if (iface.isDiscount_Greater0())
{
// Rule R06 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 6);
iface.doApplyDiscount();
iface.doInvoiceTotal_Upd();
// Rule R06 <----
}
else // Discount none - no discount given
{
// Rule R07 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 7);
iface.doInvoiceTotal_Pov();
// Rule R07 <----
}
}
// Epilog Standard ---->
// profile LFET.Java.Epilog.Standard.Interface.Dt.ini not found
// used LF-ET 2.4.1 (260219a) build in default
}
}
// Epilog Standard <----
// End of generated Java source code
// Generated by LF-ET 2.4.1 (260219a), https://www.lohrfink.de/lfet
|
The Trace code
}
else // Discount type EUR - fixed amount, will be deducted from the purchase order value
{
if (iface.isDiscountLessPurchaseOrderValue())
{
// Rule R03 ---->
iface.doTrace("InvoiceTotal", "20260224.152032", 7, 3);
iface.doApplyDiscount();
iface.doCalculateShippingCosts();
iface.doInvoiceTotal_Upd();
// Rule R03 <----
}
else // Discount < Purchase order value N - No
{
The trace code does not have to be used, but that would be a shame since the benefits are enormous:
-
Always perfectly positioned automatically
-
the first statement in each rule
-
before the first action is executed
-
i.e. the combinatoric of all input values and thus the rule to be executed is finally fixed
-
all objects in question are still “untouched” BEFORE being processed by the rule
-
in debugging, this would be called a perfect break point
-
-
In order to be able to follow software behaviour
-
the trace output logs
-
and the decision tables are sufficient
-
no need to analyze source codes anymore
-
also – in most cases – repeated runs for reproducing and analyzing misconduct are no longer necessary
-