I currently investigate the use of Drools for the OSGi Bundle Resolver algorithm.
To that respect I wonder what is the recommended way to count a certain fact. I'd like
to fire an action if there is exactly one fact for a given constraint
| rule "Use WireCandidate"
| when
| $import : ImportPackage( exporter == null )
| $wc : WireCandidate( importPackage == $import )
| // TODO: only do this if there is exactly one WireCandidate
| then
| System.out.println("Use WireCandidate " + $wc.getImportPackage() +
" --> " + $wc.getExportPackage());
| modify ( $wc.getImportPackage() ) { setExporter( $wc.getExportPackage() ) };
| retract ( $wc );
| end
|
|
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264893#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...