How to define keywords that represent objects(in facts) to be able to use in rules
by san_drools
Hello,
I need to know how to proceed to define keywords that represent
objects of facts in Drools.
In detail, i am using Guvnor editor to write Business and
technical rules required on a package basis for an application. So, here
writing rules by using Objects and it's attributes synactically is a tedious
job for client.
So, the idea is "to provide some keywords to the client where each
keyword represents an object/attribute. By using keywords simply, the client
will write a rule. These keywords shall be processed (may be at compile
time) and the respective object/attribute shall be used/considered in rule
when the rules are fired"
To achieve this,
1. worked with DSL configurations but it fulfilled our idea
partially as every #condition and #action needs to be defined in DSL
configurations to be able to use them in a rule.
2. Tried working on guvnor sources for it, but couldn't be able
to do (as i am new to drools; i am a learner)
Can any one please suggest the way we can proceed to achieve this
requirement. Is 'working on guvnor sources' only the possible way for this?
Or is there any option/feature we can proceed with? Please let me know.
Thanks in advance.
Regards
San_Drools
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-define-keywords-that-represent-o...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Weird drools exception happens from times to times
by Paulo Reis
Hi guys,
This exception is bothering me. I have a server running drools in after few days, drools starts throwing it and I have to recompile all the knowledge packages to make it work again.
Does anyone knows what is triggering it?
Thanks in advance.
SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=25;_ThreadName=Thread-2;|java.lang.ClassCastException: org.drools.reteoo.FromNode cannot be cast to org.drools.reteoo.BetaNode
at org.drools.reteoo.ReteooBuilder.resetMasks(ReteooBuilder.java:303)
at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:267)
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:459)
at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:1107)
at org.drools.common.AbstractRuleBase.mergePackage(AbstractRuleBase.java:851)
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:610)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472)
at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:150)
Paulo Reis
casmeiron(a)gmail.com
12 years, 4 months
Drools with rules from database
by debchamps
Hi
I have the following requirement
The rule is like if(employeeType == $1) set salary = $1
emloyeeType salary
--------------- ---------------
MANAGER 100
SR Manager 200
Director 300
Now new employeeType gets added every day. So the requirement is to update
the knowledgebase without again activating the service.
So how to achieve that with Drools. I am using Drools with a Decision table
for a different requirement in the same project. So if it can be achieved
with decision table it would be great(So new rows will get added to the
decision table dynamically but no column in this case).
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-with-rules-from-database-tp40193...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
java.lang.NoSuchFieldError: COMPILER_OPT_ALLOW_RESOLVE_INNERCLASSES_WITH_DOTNOTATION
by Suvek
Hi,
I have two projects 'validation' and 'service'. When I execute the rules
from unit tests under 'validation' project everything works fine. When the
same validations are invoked from 'service' project (service has mvn
dependency on validation project) I get the following error on the line
ResourceFactory.newClassPathResource(resourcePath, ResourceType.DRL );
java.lang.NoSuchFieldError:
COMPILER_OPT_ALLOW_RESOLVE_INNERCLASSES_WITH_DOTNOTATION
I looked up for the related issues but everyone says it is version mismatch,
in my case its the same jars that are used in both the cases.
what could be the reason?
thanks
--
View this message in context: http://drools.46999.n3.nabble.com/java-lang-NoSuchFieldError-COMPILER-OPT...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Conditions on the accumulation function
by senyatur
Hi everyone
We are having rules using drools fusion, sliding windows and accumulation
functions.
Example:
when
Number($count1 : longValue , longValue >= $parameter) from accumulate(
TestingClass($status : status , a=5, b=6) over window:length( 7 ) from
entry-point "EntryPoint" , count($status) )
then
// some java code...
What happens is that only objects of type TestingClass with a=5 and b=6 are
inserted into the window.
What we are trying to achieve is count how many TestingClass objects of *any
last 7* TestingClass objects meet the condition (a=5,b=6).
This obviously isn't met because the window contains only objects meeting
the condition.
Is there a way to put a condition on the *count* function and not on
*window*?
Thanks!
--
View this message in context: http://drools.46999.n3.nabble.com/Conditions-on-the-accumulation-function...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Create a JPAKnowledgeService via Spring ?
by dunnlow
I am using the drools integration server (v5.4) (thus Spring v3) and trying
to configure a session that persists to a (mysql) database and reloads on
startup.
It seems like JPAKnowledgeService should fit the bill, except I'm at a loss
as to how/if it can be used in a Spring environment.
http://docs.jboss.org/drools/release/5.4.0.Final/knowledge-api-javadoc/or...
I also tried manually configuring persistence like:
<drools:ksession id=".." type="stateful"..>
<drools:configuration>
<drools:jpa-persistence>
<drools:transaction-manager ref="jpaTxManager"/>
<drools:entity-manager-factory ref="jpaEntityManagerFactory"/>
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>
and this is working (at least, I see the SessionInfo table getting updated),
but then how to reload this session startup (** via Spring)?
Thanks for any insight,
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Create-a-JPAKnowledgeService-via-Spring...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months
Need assistance: Guvnor 5.3.1 throws null pointer exception when importing repository.xml
by Nancy Henggeler
Need assistance: Guvnor 5.3.1 throws null pointer exception when importing
repository.xml. Below is the stack trace.
I am running this on glassfish server 3.1.2
Any assistance would be greatly appreciated. Thanks.
[#|2012-08-22T10:30:49.785-0500|WARNING|oracle-glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=34;_ThreadName=Thread-2;|StandardWrapperValve[RepositoryBackupServlet]:
PWC1406: Servlet.service() for servlet RepositoryBackupServlet threw
exception
java.lang.NullPointerException
at
org.drools.guvnor.server.files.RepositoryBackupServlet$1.execute(RepositoryBackupServlet.java:84)
at
org.drools.guvnor.server.files.RepositoryServlet.doAuthorizedAction(RepositoryServlet.java:75)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.doPost(RepositoryBackupServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1542)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:65)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at
com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at
com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:722)
|#]
--
View this message in context: http://drools.46999.n3.nabble.com/Need-assistance-Guvnor-5-3-1-throws-nul...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 4 months