Instant Drools Starter : Pack Publishing (Jeremy Ary)
by Mark Proctor
http://blog.athico.com/2013/03/instant-drools-starter-pack-publishing.html
We all start somewhere. My start with Drools came 5 years ago when I was tasked with maintaining some legacy rules and assisting with a new ground-up effort using the latest and greatest Drools release at the time. I dug through documentation, ordered every book I could find on the subject, and pestered Mark, Edson and others in the community willing to help way more than they probably cared for, but in the end, the community helped start me out with what I'd soon find to be my new obsession. Now, I feel like it's time for me to give something back.
If you're an architect, manager, or developer looking to evaluate or get started with Drools, you may find my new book, Drools Starter, to be a great way to get up and running quickly. I've done my best to compile all the basics needed to get a feel for working with the core engine into a brief, easy-to-digest guide. Here's some of what's covered inside:
Evaluate rules engines as a fit for your needs
Installing Drools and development tools
Authoring rule sets using the Drools Rule Language
Feeding information to your rules engine and evaluating rules
Understanding DRL syntax, operators, and functionality
Testing rules as a whole, individually, and for stability
Debugging the rule evaluation process visually and via logging
What modules make up the Drools system and the capabilities of each
Where to turn for more information and help
The book is currently available for pre-order (at a 20% discount!) over at Pack Publishing:
http://www.packtpub.com/getting-started-with-drools/book
I owe a large thanks to the community in helping me on my way through the last several years, especially to those in IRC and the mailing list who've aided with numerous predicaments and design choices along the way. Particular thanks to Mark, Edson and the rest of the development team for continued work on a great product and a great community, but especially to the two of you for spending too many hours in conversation online and at conferences helping myself and others like me find their way.
11 years, 10 months
Ignore subsequent conditions in a Decision Table based on previous condition
by ciberg2
Hi, I'm new to Drools and I'm implementing rules using Excel decision tables
and I need some of your help.
I have some rules in which depending on a condition the following condition
is not necessary, how can I define a table that akllows to define this?
For instance I have:
CONDITION CONDITION CONDITION ACTION
Y
result1
N N Y
result2
N N N
result3
N Y N
result4
N Y Y
result5
In the example above (I hope you can see it right) if the first condition
value is Y the other 2 conditions values don't matter and despite their
value the result will always be the same.
I wouldn't want to have to write all the possible combinations as these in
the real case will add a lot of complexity to the tables.
How can I accomplish this? Is it possible to do it in Excel? If not, how can
I do it in another way (for instantance with guvnor web-based tables).
--
View this message in context: http://drools.46999.n3.nabble.com/Ignore-subsequent-conditions-in-a-Decis...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Drools 5.5 and jBPM 5.4 on Weblogic 10.3.4
by abhishekbiyala
Hi,
I have been struggling to get drools 5.5 and jBPM 5.4 embedded in a weblogic
10.3.4 application.
Seems like there is some conflict between drools and weblogic jars. But how
to resolve?
This is the exception I am getting -
java.lang.NoSuchMethodError:
org.drools.util.CompositeClassLoader.clone()Lorg/drools/util/CompositeClassLoader;
at
org.drools.compiler.PackageBuilderConfiguration.getClassLoader(PackageBuilderConfiguration.java:362)
at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:98)
at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:61)
at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:317)
at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:307)
at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:192)
at
org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:170)
at
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactoryServiceImpl.java:22)
at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactory.java:75)
at
org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:80)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at
weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
at
weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
at
weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
at
weblogic.application.internal.EarDeployment.activate(EarDeployment.java:58)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:569)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:150)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:116)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:323)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at
weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at
weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Thanks,
Abhishek
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-5-and-jBPM-5-4-on-Weblogic-10-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Freezing repositories drools + droolsjbpm-knowledge on Friday 15-MAR-2013
by Geoffrey De Smet
To fix the OSGi split-packages problem,
we'll be freezing the following repositories this Friday 15-MAR-2013:
droolsjbpm-knowledge
drools
A lot of package directory's will change on master.
*Please make sure you 've pushed all your local changes by Thursday
evening.*
Don't push on Friday - until I 've send a mail that's ok.
Most pull requests have been merged/closed in the last weeks (thanks to
Mario), so they don't go stale.
What will happen?
All kie-api.jar packages will be moved from
org.kie
to
org.kie.api
All kie-internal.jar packages will be moved from
org.kie
to
org.kie.internal
All drools-core.jar packages will be moved from
org.drools
to
org.drools.core
All drools-compiler.jar packages will be moved from
org.drools
to
org.drools.compiler
...
Why?
https://issues.jboss.org/browse/DROOLS-57
https://issues.jboss.org/browse/JBRULES-3574
11 years, 10 months
Help with DefaultAgenda.java
by Mallory
Hello,
I have tried to change the source code of DefaultAgenda.Java by adding the
code below:
//drools orginial sequential code
/*
while ( continueFiring( fireLimit ) && fireNextItem( agendaFilter )
) {
fireCount++;
fireLimit = updateFireLimit( fireLimit );
this.workingMemory.executeQueuedActions();
}
*/
//code with concurrency
InternalAgendaGroup myGroup = (InternalAgendaGroup) getNextFocus();
fireCount = myGroup.size();
for(int i =0; i< fireCount; ++i)
{
new Thread(new Runnable(){
public void run()
{
fireNextItem( agendaFilter );
}
}).start();
}
I am getting an Errorjava.lang.NullPointerException because my code flow is
going to consequenceExceptionHandler ! = null exception.
else if ( this.consequenceExceptionHandler != null ) {
this.consequenceExceptionHandler.handleException(
activation, this.workingMemory.getKnowledgeRuntime(),
e );
Could you kindly help me with this?
I am pasting the exception below and I am using Drools 5.4 Final version.
In DA: [Activation rule=Rule 1, act#=0, salience=0, tuple=[fact
0:0:1773684356:1306428912:0:DEFAULT:org.drools.reteoo.InitialFactImpl@4dde85f0]
]
Exception in thread "Thread-1" Exception in thread "Thread-0" Exception
executing consequence for rule "Rule 1" in defaultpkg:
java.lang.NullPointerException
In DA WM: org.drools.impl.StatefulKnowledgeSessionImpl@542487b1
In DA Errorjava.lang.NullPointerException
In DA: [Activation rule=Rule 2, act#=1, salience=0, tuple=[fact
0:0:1773684356:1306428912:0:DEFAULT:org.drools.reteoo.InitialFactImpl@4dde85f0]
]
In DA WM: org.drools.impl.StatefulKnowledgeSessionImpl@542487b1
In DA Errorjava.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1208)
at org.drools.common.DefaultAgenda$1.run(DefaultAgenda.java:1471)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1272)
... 3 more
Exception executing consequence for rule "Rule 2" in defaultpkg:
java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1287)
at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1208)
at org.drools.common.DefaultAgenda$1.run(DefaultAgenda.java:1471)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1272)
... 3 more
Thanks a lot for the help.
Regards,
Malory
--
View this message in context: http://drools.46999.n3.nabble.com/Help-with-DefaultAgenda-java-tp4022758....
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months
Error in Activator.java
by Mallory
Hi All,
I am new to drools and I am looking forward to receive help from experts out
here. I have created a new drools project where I will be using
drools-distribution-5.4.0.Final.
I have created three Source folders for drools-compiler-5.4.0.Final-sources,
drools-core-5.4.0.Final-sources and knowledge-api-5.4.0.Final-sources.
I have imported all the other binaries/JAR's available from the same
drools-distribution-5.4.0.Final folder using Java Build path.
I have been getting errors in all the three source folders and the errors
are related to Activator.java.
In all the import statements I am getting an error called The import
org.osgi cannot be resolved.
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.osgi.framework.ServiceRegistration;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
I am not sure where to find org.osgi. Any help related to this is greatly
appreciated.
Thanks in advance,
Mallory
--
View this message in context: http://drools.46999.n3.nabble.com/Error-in-Activator-java-tp4022753.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 10 months