Speeding up Drools
by Phani Saripalli
HI.
I am using declared types in my .drl file. I have a declared type with 1000
fields (using the Drools 5.5. beta, so 1000 fields is allowed). I have 100
rules. However, creating the stateful knowledge base is very slow. It is
taking nearly 8 seconds. Can somebody tell me, suggest how can I speed up
the process?
Briefly, this is how I measured.
long loadI = System.currentTimeMillis();
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
ksession.setGlobal("cList", new ArrayList<Integer>());
FactType fact = kbase.getFactType("com.sample", "Project");
Object projIns = fact.newInstance();
ksession.insert(projIns);
long loadO = System.currentTimeMillis();
System.out.println("time to load facts : " + ((loadO / 1000.0) -
(loadI / 1000.0)));
ksession.getAgenda().getAgendaGroup("Group Config").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Fact Config").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 0").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 1").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 2").setFocus();
ksession.fireAllRules();
Many thanks
Phani
--
View this message in context: http://drools.46999.n3.nabble.com/Speeding-up-Drools-tp4020132.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Drools-Planner consulting on rule-set
by drools@orbit-x.de
Hi,
in drools planner I have built an application that has a rule-set with 6 hard-constraint rules and 6 soft-constraint rules. I am optimizing this rule-set now and then already for a very long time (around 2 years).
Currently I am having difficulty with solving local optima problem for this rule-set and am stuck for 2-3 weeks already without any improvement (I think I am missing some POSITIVE soft constraints to achieve score improvement within short number of steps).
So I would like to ask you, guys, if someone would consult me and help me to unstuck. I would gladly pay for your effort and estimate that approx. 8 man-hours should be enough for a drools rules professional to help me to move on.
If you are interested, please contact me with your quotes.
If we reach an agreement, I will send you domain model and rule-set and then we hold 1-2 phone calls to discuss changes in rule-set and domain model. If you would take a look on rule-set before you quote, please let me know.
Thank you and kind regards
Reinis
13 years, 5 months
Communication Error
by paco
Hello Everybody,
I've this error want I'm verifing my rules with guvnor:
Communication Error. This could be caused because you don't have access to
the remote server, or because your browser is in Offline Mode. Please check
your connection and try again. If the problem persists please contact the
System Administrator.
Somebody can tell me what's the probleme?
Thanks
Paco
--
View this message in context: http://drools.46999.n3.nabble.com/Communication-Error-tp4020102.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Drools and Weld dependency ?
by Cristiano Gavião
Hi,
I'm trying to use JBPM 5.4-SNAPSHOT and Drools 5.5-SNAPSHOT in a OSGi env.
drools-compiler's generated manifest has a import package to
org.jboss.weld.environment.se.discovery.url.
Could someone explain me what is this new dependency ? Weld is really
mandatory to drools 5.5 ?
thanks,
Cristiano
13 years, 5 months
Accumulate a on event combinations
by gboro54
We are using expert and fusion to monitor connection events in our system. We
would like to know the most efficient way to know that X number pair of
events have happened in a certain example(i.e eventA and eventB occurred 4
times each in the 5 seconds). What is the most efficient way to do this? I
don't believe an accumulate would allow a combination of objects but I may
be wrong. Perhaps a live query invoked by a rule?
--
View this message in context: http://drools.46999.n3.nabble.com/Accumulate-a-on-event-combinations-tp40...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
@expires
by gboro54
Based on testing expiring an event does no remove it from working memory.
What is the best way to manage working memory in the case that after a
period of X seconds you want the event removed? Would you simply write a
rule that would do a retract after a certain window i.e
rule "Closed Connection Occured"
when
$e:Event(connectionEventType == ConnectionEventType.CLOSE this after [20s]
this)
then
retract($e);
end
--
View this message in context: http://drools.46999.n3.nabble.com/expires-tp4020117.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
Error deploying Guvnor 5.4 on Weblogic 10.3.5
by droolist
I am trying to deploy Guvnor 5.4.0 Final on Weblogic Server 10.3.5.
Unzipped guvnor-5.4.0.Final-tomcat-6.0.war and tried to deploy the open
directory.
First, I was getting this error...
ClassNotFoundException: org.jboss.weld.environment.servlet.Listener
So, I got weld-1.1.8.Final and dropped weld-servlet.jar into WEB-INV/lib
After I put this jar, it deployed successfully.
But, when I try to access the page, I am getting this error...
Caused By: java.lang.IllegalStateException: CDI hasn't been properly
started.
Make sure your IDE classpath is in sync with the real maven classpath.
The classpath should include weld-servlet.
at
org.drools.guvnor.server.SecurityServiceServlet.getCurrentUser(SecurityServiceServlet.java:66)
Has anybody been successful in deploying Guvnor 5.4 on Weblogic 10.3.5?
thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Error-deploying-Guvnor-5-4-on-Weblogic-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
droolsjbpm-build-bootstrap script is broken ?
by Cristiano Gavião
Hi,
I want to investigate why I couldn't build my system using the latest
snapshot of jbpm and drools..
So, I cloned the
git@github.com:droolsjbpm/droolsjbpm-build-bootstrap.git repository and
I'm following the readme.md file.
When I try $ droolsjbpm-build-bootstrap/script/git-clone-others.sh, I'm
getting a error:
===============================================================================
This directory already exists: droolsjbpm-build-bootstrap
===============================================================================
===============================================================================
Repository: droolsjbpm-knowledge
===============================================================================
Too many arguments.
usage: git clone [options] [--] <repo> [<dir>]
-v, --verbose be more verbose
-q, --quiet be more quiet
Am I missing something or the script is broken ?
regards,
Cristiano
13 years, 5 months
JtaTransactionManager couldn't find UserTransaction
by gkalabin
Hi everybody!
I'm using jBPM 5.3.0.Final, Drools 5.4.0.Final and JBoss 7.1.1.
I'm trying to run jbpm with human task service.
When I start processes without human tasks everything works fine. But when I
try to run process with human task I get the following exception (see full
error log in attachments):
Caused by: java.lang.NullPointerException
at
org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:205)
[drools-persistence-jpa-5.4.0.Final.jar:5.4.0.Final]
at
org.jbpm.task.service.persistence.TaskJTATransactionManager.getStatus(TaskJTATransactionManager.java:63)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
at
org.jbpm.task.service.persistence.TaskJTATransactionManager.begin(TaskJTATransactionManager.java:36)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
at
org.jbpm.task.service.persistence.TaskPersistenceManager.beginTransaction(TaskPersistenceManager.java:79)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
at
org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:976)
[jbpm-human-task-core-5.3.0.Final.jar:5.3.0.Final]
... 28 more
I init HumanTaskService and jBPM in following way:
Environment JBPM_ENVIRONMENT = KnowledgeBaseFactory.newEnvironment();
JBPM_ENVIRONMENT.set(EnvironmentName.ENTITY_MANAGER_FACTORY,
Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa"));
JBPM_ENVIRONMENT.set(EnvironmentName.TRANSACTION_MANAGER,
TransactionManagerServices.getTransactionManager());
JBPM_ENVIRONMENT.set(EnvironmentName.GLOBALS, new MapGlobalResolver());
Properties properties = new Properties();
properties.put("drools.processInstanceManagerFactory",
"org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");
properties.put("drools.processSignalManagerFactory",
"org.jbpm.persistence.processinstance.JPASignalManagerFactory");
KnowledgeSessionConfiguration JBPM_CONFIG =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("org.jbpm.task");
TaskService taskService = new TaskService(emf,
SystemEventListenerFactory.getSystemEventListener());
MinaTaskServer taskServer = new MinaTaskServer(taskService);
// start the server
Thread thread = new Thread(taskServer);
thread.start();
TaskClient taskClient = new TaskClient(new
MinaTaskClientConnector("myHtsClient",
new
MinaTaskClientHandler(SystemEventListenerFactory.getSystemEventListener())));
if (!taskClient.connect(TASK_CLIENT_SERVER_ADDRESS,
TASK_CLIENT_SERVER_PORT)) {
logger.error("Could not connect task client");
}
StatefulKnowledgeSession session =
JPAKnowledgeService.newStatefulKnowledgeSession(readKnowledgeBase(),
JBPM_CONFIG, JBPM_ENVIRONMENT);
session.getWorkItemManager().registerWorkItemHandler("Human Task", new
MinaHTWorkItemHandler(session));
I had an experiment: before a process start and after it I looked up the
UserTransaction:
try {
logger.info("found: " + new
InitialContext().lookup("java:comp/UserTransaction"));
} catch (NamingException e) {
logger.info("not found", e);
}
// start process code
try {
logger.info("found: " + new
InitialContext().lookup("java:comp/UserTransaction"));
} catch (NamingException ex) {
logger.info("not found", ex);
}
The name java:comp/UserTransaction I took from
org.drools.persistence.jta.JtaTransactionManager which falls with NPE.
It still falls and in my log:
found: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1033fb5
com.example.my.jbpm.rest.ProcessManagementResources http--127.0.0.1-8080-2
No UserTransaction found at JNDI location [java:comp/UserTransaction]
org.drools.persistence.jta.JtaTransactionManager NioProcessor-2
found: org.jboss.tm.usertx.client.ServerVMClientUserTransaction@1033fb5
com.example.my.jbpm.rest.ProcessManagementResources http--127.0.0.1-8080-2
--
View this message in context: http://drools.46999.n3.nabble.com/JtaTransactionManager-couldn-t-find-Use...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months