History log with mySQL Database
by timpe
I'm trying to establish a history log for my Flow. I'm using version 5.0.1
and I set up my project with maven. So I'm using drools-bam-5.0.1.jar
Inside this archive there is a META-INF folder containing the
hibernate-instructions. How can I reconfigure these settings?
I tried to put the hibernate.cfg.xml and the
AuditLog.hbm.xml into the META-INF-folder in my root Project without
success (default Settings from jar-file are used).
While using the drools-bam archive (jar from the maven-repository), I got
the following error:
Not supported session in logger: class
org.drools.process.command.impl.CommandBasedStatefulKnowledgeSession
I debugged it and found out that he jumps out in WorkingMemoryLogger in Line
136:
else if (session instanceof CommandBasedStatefulKnowledgeSession) {
WorkingMemoryEventManager eventManager =
((CommandBasedStatefulKnowledgeSession)
session).getCommandService().getSession();
eventManager.addEventListener( (WorkingMemoryEventListener) this );
eventManager.addEventListener( (AgendaEventListener) this );
eventManager.addEventListener( (RuleFlowEventListener) this );
eventManager.addEventListener( (RuleBaseEventListener) this );
} else {
The Session is an instance of
org.drools.process.command.impl.CommandBasedStatefulKnowledgeSession
When I add the source-File of the WorkingMemoryLogger into my project, then
this error does not occur.
Any Ideas?
Thanks
Timo
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/History-log-with-mySQ...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
FileNotFoundException for drl file in classpath
by bcarlson
Hello,
I'm relatively new to drools, and although I've gotten my first app working
from the command line, I am not incorporating it into a web app, and having
a heck of a time getting the drl file found!
Long story short, the drl file is in the package: com.abc.xyz
I'm trying to load it with the following:
kbuilder.add(ResourceFactory.newClassPathResource("keyRules.drl",this.getClass()),ResourceType.DRL);
and I've placed it in about 42 places throughout my app in the futile
attempt to get it to load. What am I missing? Can someone help me understand
the whole classpath loading? I mean, I've put the path to the .drl file in
my classpath, and it's simply not finding the file.
Thanks for your help!
-an exasperated newbie drools user
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/FileNotFoundException...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
Login Names for drools-5.0-guvnor installed on Tomcat 6
by Zhuk, Yefim
My question is related to Login Names for drools-5.0-guvnor installed on Tomcat 6.
A Guvnor tutorial offers an example for JBoss AS on how to provide user name/password.
Can you provide a similar example for the Tomcat 6 case? How to config 2-3 names for the
admin role?
I hope that the question is easy for someone who is already working in this environment.
Thank you so much for your help,
Jeff
14 years, 6 months
Activation-group does not work when using a Stateless Session with Sequential Mode enabled
by Nathan Bell
We spent some time trying to figure out why our activation-group
functionality was not working. Activation groups are supposed to cause only
a single rule to fire within the same group. What we were experiencing is
that all the rules were firing, essentially ignoring the activation-group
setting. We have determined that it is because we were setting an option on
the KnowledgeBaseConfiguration of Sequential.Yes. If we comment out that
line activation-groups work.
I don't know enough to know if this is by design or if it is a bug. I
searched the documentation and the drools-user Nabble forum and could not
find an answer to this issue. I wanted to at least post this information so
that if anyone else has this problem they don't have to go through the same
struggle we had.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Activation-group-does...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
Re: [rules-users] Guvnor meant for business users?
by nxg912
Thanks for your message.
Regarding the scenario, we were able to build the POJO model and other
required dependencies but are not able to figure out that while working with
Guided Editor, how to get access to internal properties of these objects,
i.e. how to include those in the WHEN and THEN sections.
Also, around Guvnor, our intention is to make this usable for business
analyst and subject matter experts, i.e. they should be able to configure
the rules and test them as well. Our understanding is that Guvnor and DSL
are the options. At this point, to us, DSL seems like a better option than
Guvnor from business analyst perspective. We are currently unable to build
even slightly complex scenario and their corresponding test scenarios in
Guvnor. So we were wondering if others in this forum are also reverting to
DSL in case they want to get BA involved. Our impression on DRL has been
very good as that allows you to build complex rules relatively quickly.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Guvnor-meant-for-busi...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
Moving from Jrules to Drools a couple of Issues
by paulnnosh
Hi Chaps,
We currently use Jrules 5 and are looking at our options going forward. We
are going to evaluate Drools alongside some other products. So far I like
the look of Drools but there are a couple of things that are puzzling me...
- In our Jrules implementation our BOM/XOM exposes some of our application
logic so that our rules can access application code and services to make
decisions and updates where necessary. I can't see how this is possible in
Drools.
- Our ruleflows use decision tables to define which rules will run dependant
upon the transaction type received. This makes assigning a rule to a single
ruleflow group inappropriate as one rule could be used by many different
transactions. Is it possible to create an ArrayList of rules and execute
them one at a time via ruleflow action node?
Many Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Moving-from-Jrules-to...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
[Drools Fusion] Can't detect 2 occurrences with sliding window
by Xavier Coulon
Hello,
I'm new to Drools (5.0.1) and i've tryied the following (basic) fusion rule
for a few days now without success.
The rule is to determine if a user performs 2 operations in the sliding
window of 60s. In such a condition, a log message should be triggered.
Here is my DRL code :
# declare events
declare Operation
@role(event)
@timestamp(date)
end
rule "overActivity"
dialect "mvel"
when
#condition : 2 operation in less than 1 minute
$operation1 : Operation()
over window:time(60s) from entry-point "OperationStream"
$operation2 : Operation(this != $operation1, ipAddress ==
$operation1.ipAddress)
over window:time(60s) from entry-point "OperationStream"
then
#actions
System.out.println("over-active user " + $operation1.ipAddress );
end
And my JUnit test, using a PSEUDO Clock :
public class DroolsRulesTestCase {
static KnowledgeBase knowledgeBase;
StatefulKnowledgeSession session;
// FactHandle handle;
SessionPseudoClock clock;
WorkingMemoryEntryPoint entryPoint;
private TrackingAgendaEventListener listener;
private static final Logger LOGGER = Logger
.getLogger(DroolsRulesTestCase.class);
@BeforeClass
public static void globalSetup() throws IOException {
KnowledgeBuilder builder = KnowledgeBuilderFactory
.newKnowledgeBuilder();
ClassPathResource classPathResource = new ClassPathResource(
"rules/activity-fusion.drl");
Assert.assertTrue("Rules resource not found", classPathResource
.exists());
builder.add(ResourceFactory.newInputStreamResource(classPathResource
.getInputStream()), ResourceType.DRL);
Assert.assertFalse("Errors in builder:"
+ builder.getErrors().toString(), builder.hasErrors());
KnowledgeBaseConfiguration configuration = KnowledgeBaseFactory
.newKnowledgeBaseConfiguration();
configuration.setOption(EventProcessingOption.STREAM);
knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase(configuration);
knowledgeBase.addKnowledgePackages(builder.getKnowledgePackages());
}
@Before
public void setup() {
KnowledgeSessionConfiguration configuration = KnowledgeBaseFactory
.newKnowledgeSessionConfiguration();
configuration.setOption(ClockTypeOption.get("pseudo"));
session = knowledgeBase
.newStatefulKnowledgeSession(configuration, null);
clock = (SessionPseudoClock) session.getSessionClock();
listener = new TrackingAgendaEventListener();
session.addEventListener(listener);
session.addEventListener(new TrackingWorkingMemoryEventListener());
entryPoint = session.getWorkingMemoryEntryPoint("OperationStream");
}
@SuppressWarnings("unchecked")
@Test
public void testActivity() throws IOException, ParseException,
InterruptedException {
// parse the log file
Resource logFile = new ClassPathResource(
"activity/extract.log");
// converter and inject tracks in the session,
List<String> logLines = FileUtils.readLines(logFile.getFile(), "UTF-8");
// fire all rules
session.fireAllRules();
LOGGER.info("loading events");
// load events from stream
for (String logLine : logLines) {
Operation operation = LineConverterUtil.getOperation(logLine);
LOGGER.debug("Inserting " + operation);
LOGGER.debug("Moving clock from "
+ (new Date(clock.getCurrentTime())).toString() + " to "
+ operation.getDate());
clock.advanceTime(operation.getDate().getTime()
- clock.getCurrentTime(), TimeUnit.MILLISECONDS);
// clock.advanceTime(10, TimeUnit.SECONDS);
FactHandle operationHandle = entryPoint.insert(operation);
LOGGER.debug("Insertion done: " + operationHandle.toExternalForm());
}
LOGGER.info("done with events");
// check...
Assert.assertTrue("Rule not fired...", listener
.isRuleFired("overActivity"));
}
}
I also use a TrackingWorkingMemoryEventListener to track events.
The test because since the rule is not fired, and the log contains the
following lines :
Console> 2010-05-17 11:15:15|INFO ||DroolsRulesTestCase.testActivity|loading
events
Console> 2010-05-17
11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Inserting Operation
[date=Fri Apr 30 18:26:47 CEST 2010, executionTime=1, hostname=server1,
ipAddress=1.2.3.4, operation=null, requestSize=0, responseSize=0]
Console> 2010-05-17 11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Moving
clock from Thu Jan 01 01:00:00 CET 1970 to Fri Apr 30 18:26:47 CEST 2010
Console> 2010-05-17 11:15:15|WARN
||TrackingWorkingMemoryEventListener.objectInserted|Object inserted: [event
fid:1:1:Operation [date=Fri Apr 30 18:26:47 CEST 2010, executionTime=1,
hostname=server1, ipAddress=1.2.3.4, operation=null, requestSize=0,
responseSize=0]]
Console> 2010-05-17
11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Insertion done: [event
fid:1:1:Operation [date=Fri Apr 30 18:26:47 CEST 2010, executionTime=1,
hostname=server1, ipAddress=1.2.3.4, operation=null, requestSize=0,
responseSize=0]]
Console> 2010-05-17
11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Inserting Operation
[date=Fri Apr 30 18:27:11 CEST 2010, executionTime=164, hostname=server1,
ipAddress=1.2.3.4, operation=CONSULTATION, requestSize=1299,
responseSize=895]
Console> 2010-05-17 11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Moving
clock from Fri Apr 30 18:26:47 CEST 2010 to Fri Apr 30 18:27:11 CEST 2010
Console> 2010-05-17 11:15:15|WARN
||TrackingWorkingMemoryEventListener.objectRetracted|Object retracted:
[event fid:1:1:Operation [date=Fri Apr 30 18:26:47 CEST 2010,
executionTime=1, hostname=server1, ipAddress=1.2.3.4, operation=null,
requestSize=0, responseSize=0]]
Console> 2010-05-17 11:15:15|WARN
||TrackingWorkingMemoryEventListener.objectInserted|Object inserted: [event
fid:2:2:Operation [date=Fri Apr 30 18:27:11 CEST 2010, executionTime=164,
hostname=server1, ipAddress=1.2.3.4, operation=CONSULTATION,
requestSize=1299, responseSize=895]]
Console> 2010-05-17
11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Insertion done: [event
fid:2:2:Operation [date=Fri Apr 30 18:27:11 CEST 2010, executionTime=164,
hostname=server1, ipAddress=1.2.3.4, operation=CONSULTATION,
requestSize=1299, responseSize=895]]
Console> 2010-05-17
11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Inserting Operation
[date=Fri Apr 30 18:28:47 CEST 2010, executionTime=1, hostname=server1,
ipAddress=1.2.3.4, operation=null, requestSize=0, responseSize=0]
Console> 2010-05-17 11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Moving
clock from Fri Apr 30 18:27:11 CEST 2010 to Fri Apr 30 18:28:47 CEST 2010
Console> 2010-05-17 11:15:15|WARN
||TrackingWorkingMemoryEventListener.objectRetracted|Object retracted:
[event fid:2:2:Operation [date=Fri Apr 30 18:27:11 CEST 2010,
executionTime=164, hostname=server1, ipAddress=1.2.3.4,
operation=CONSULTATION, requestSize=1299, responseSize=895]]
Console> 2010-05-17 11:15:15|WARN
||TrackingWorkingMemoryEventListener.objectInserted|Object inserted: [event
fid:3:3:Operation [date=Fri Apr 30 18:28:47 CEST 2010, executionTime=1,
hostname=server1, ipAddress=1.2.3.4, operation=null, requestSize=0,
responseSize=0]]
Console> 2010-05-17
11:15:15|DEBUG||DroolsRulesTestCase.testActivity|Insertion done: [event
fid:3:3:Operation [date=Fri Apr 30 18:28:47 CEST 2010, executionTime=1,
hostname=server1, ipAddress=1.2.3.4, operation=null, requestSize=0,
responseSize=0]]
Console> 2010-05-17 11:15:15|INFO ||DroolsRulesTestCase.testActivity|done
with events
I guess there is something wrong with my use of the PseudoClock, since
previous operations are retracted before a new one is inserted, which I
believe prevents the rule to be fired.
Can you help me ?
Thank you in advance
Regards,
Xavier
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Fusion-Can-t-d...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 6 months
Drools Roadmap - Planned Release 5.1 release date
by McDonald, Daniel
Hi,
I was wondering if there is a planned release date for Release 5.1?
Thank you,
Daniel McDonald
Fidelity National Information Services - Research & Development
Office phone: (972) 691-6593
Mobile phone (214) 697-8163
_____________
The information contained in this message is proprietary and/or confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; (ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
please be aware that any message addressed to our domain is subject to archiving and review by
persons other than the intended recipient. Thank you.
_____________
14 years, 6 months