Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
3.2. JBoss Rules Theory
3.2.1. Methods in JBoss Rules Link kopierenLink in die Zwischenablage kopiert!
3.2.2. Method Example Link kopierenLink in die Zwischenablage kopiert!
3.2.3. Rule Example Link kopierenLink in die Zwischenablage kopiert!
3.2.4. Cross-Products Link kopierenLink in die Zwischenablage kopiert!
3.2.5. Cross-Product Constraining Link kopierenLink in die Zwischenablage kopiert!
Procedure 3.6. Task
- To prevent a rule from outputting a huge amount of cross-products, you should constrain the cross-products themselves. Do this using the variable constraint seen below:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The following output will be displayed:room:office sprinkler:office room:kitchen sprinkler:kitchen room:livingroom sprinkler:livingroom room:bedroom sprinkler:bedroom
room:office sprinkler:office room:kitchen sprinkler:kitchen room:livingroom sprinkler:livingroom room:bedroom sprinkler:bedroom
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Only four rows are outputted with the correct sprinkler for each room. Without this variable, every row in the Room table would have been joined with every row in the Sprinkler table resulting in many lines of output.
3.2.6. The Inference Engine Link kopierenLink in die Zwischenablage kopiert!
3.2.7. Inference Example Link kopierenLink in die Zwischenablage kopiert!
$p : Person() IsAdult( person == $p )
$p : Person()
IsAdult( person == $p )