event declaration using fqn
by Samuli Saarinen
Hi,
I'm trying to create event declaration using fqn in the declaration but
for some reason it doesn't work. I have the following rule:
package com.test.pkg
declare com.test.Event1
@role(event)
@expires(2s)
end
compiling it produces the following error:
[6,11]: [ERR 103] Line 6:11 rule 'end_key' failed predicate:
{(validateIdentifierKey(DroolsSoftKeywords.END))}? in com
But if I change it as follows:
package com.test.pkg
import com.test.Event1
declare Event1
@role(event)
@expires(2s)
end
Everything works as expected...
From what I've read from the users guide it should work in both cases
but am I missing something obvious here or is this possibly a bug?
I'm using Drools 5.1.0 but tested this with 5.1.1 also
Cheers,
Samuli
--
Remion Oy Etävalvontajärjestelmät liiketoiminnan
Samuli Saarinen tehostamiseen
gsm +358 (0)50 3560075
fax +358 (0)3 2125064 www.remion.com
14 years, 2 months
How to get JmsMessenger to enlist in XA transactions when receiving?
by Robert (rob3c)
Hi, I'm trying to test use of Drools pipeline (5.1.0.M2) with XA
transactions. I'd like the transaction to cover receipt of the JMS message
by JmsMessenger as well as successful addition of facts into the ksession,
flows interaction, etc., based on the message content.
I'm using the Bitronix transaction manager, Hibernate for persistence to a
SqlServer database via MS JDBC driver, and ActiveMQ for JMS. I have ActiveMQ
running in a separate process, and I'm doing everything else in a simple
standalone java app.
When not configured for XA, everything works fine. However, when configured
for XA, the log shows that the JMS resource is not enlisting in the
transaction. Hibernate enlists ok.
Before I go into further configuration detail, can anyone tell me if this is
even possible using the standard pipeline JMS functionality? Or will this
require custom code? I've searched extensively for docs or samples
discussing this, but haven't found any specifically using XA with the
pipeline JMS receiver. Any help would be greatly appreciated! :)
Thanks in advance,
Robert (rob3c)
14 years, 2 months
Problems with globals in bpmn-flows
by Mahler, Björn
Hello dear list,
I currently have problems to access global variables in a drools 5.1 bpmn rule-flow. I have a script-task at the end of my process-flow in which I want to call a method of an "external" service. I instantiated the service and set it as global in the ksession before starting the process. In the script-task I add global x.y.z.MyService myService with the same name as setted before and call the object with the method with script-type mvel/java: myService.xyz();
Is this the right way doing this? Because I'm receiving the error-message "cannot access variable with name 'myService'" or similar (can't remember exactly).
When adding the service as a "process variable" in the model and then starting the process, I can access this variable in the script-task... but - I think using globals would be much nicer for accessing the service in some of my rules in the same way under the same variable.
After all I also don't know how to access modified process-variables in my task. For example if I change some object in a rule-task before and in a script-task later I want to call a service with the modified object... do I have to read a process variable in the rule, modify it and then in the script-task I access the process-variable or could I access the changed object in the working-memory in the script-task as well? Like or similar because this is just rule-style:
when
$o : MyObject (withMyChangedParameter == 'x')
then
service.myMethod($o);
TIA
Björn
Diese E-Mail kann vertrauliche und/oder rechtlich geschützte Informationen enthalten.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information.
If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail.
Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
14 years, 2 months
Re: [rules-users] Using rule flow in Guvnor
by raic
Same problem here...
I have a simple rule flow created with Eclipse, with a Rule Node.
I uploaded this flow to Guvnor which also has the rule, and when I try to
execute it throught Execution Server, the process starts but the rule node
is never executed...
Also i'm having problems calling to the rule directly (without flows) if I
have the "ruleflow-group" tag in the rule (it works perfectly without it).
Is this a problem of "ruleflow-group"? I am missing something?
Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Using-rule-flow-in-Gu...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
Question about design
by Mauricio Cáceres
Hi Guys
I have a web application cluster receives a 800TPS in total. I'm evaluating
whether to implement the rules using Guvnor.
As design of the solution I'm thinking to implement an EJB for business
logic and my question is what is the best strategy for creating instances of
the class StatelessKnowledgeSession. My question is if you create a session
for each instance of EJB? or create the session for each time you invoke a
method? if you create the session as a static attribute of the EJB? the
session object is to synchronized?
thanks for the help
14 years, 2 months
Use Knowledge Agent
by java.developer.researcher
Hello,
I am trying of integrate Drools Guvnor with an java web application. I am
using KnowledgeAgent, but occurs the next exception when execute the code:
java.lang.RuntimeException: java.io.IOException: Server returned HTTP
response code: 401 for URL:
http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org....
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:559)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at
org.examples.test.TestKnowledgeAgent.getKnowledgeBase(TestKnowledgeAgent.java:63)
at
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:28)
Caused by: java.io.IOException: Server returned HTTP response code: 401 for
URL:
http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org....
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at
org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:76)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:512)
... 3 more
Exception in thread "main" java.lang.NullPointerException
at
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:37)
What is the cause of this exception? How can I solved it?
Any help is welcome.
Regards,
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Use-Knowledge-Agent-t...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
Starting a process in Guvnor with ruleflow-group
by John Peterson
Hi all,
I'm doing some experimentation for a business problem and I've hit a
snag when it comes to Guvnor and Ruleflow-Groups.
I'm using Guvnor 5.0.1 and Drools 5.0.1.
I've uploaded a simple 4 step (plus start and end) ruleflow-group to
Guvnor. I've added ruleflow-group attributes to all my rules,
associating them to one of the four steps in my ruleflow. My code for
the execution is as follows:
cmds.add(CommandFactory.newInsertElements(recordsToRun));
try {
KnowledgeBase kbase = readKnowledgeBase();
StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession();
ExecutionResults results =
ksession.execute(CommandFactory.newBatchExecution(cmds));
} catch(Exception e) {
System.out.println("Exception in readKnowledgeBase: " +
e.getMessage());
}
I've seen in other documentation that a "startProcess" is in order (e.g.
ksession.startProcess("ruleflowname")), however, startProcess is not
available for StatelessKnowledgeSession and the process is in Guvnor
already, not locally. I'm guessing it is something simple I've
overlooked, but it isn't clicking for me at this point and my search
online for answers hasn't found one yet. Any suggestions would be
appreciated.
Thanks!
14 years, 2 months