[jboss-dev-forums] [JBoss OSGi Development] - Use Drools for the Bundle Resolver

thomas.diesler@jboss.com do-not-reply at jboss.com
Tue Nov 10 13:07:59 EST 2009


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#4264893

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264893



More information about the jboss-dev-forums mailing list