planning difficulty problem
by Ricardo
For example , I have 10 doctors planning for 3 hospitals in three shifts,
each hospital take maximum limit of 3 doctors only, In this case I have one
remaining doctor unassigned. My doubt is how planner handle this data? will
it be rejected or consider in other cycle or overwrite the planner solution?
please advise...
thanks,
-----
with kind regards,
--
View this message in context: http://drools.46999.n3.nabble.com/planning-difficulty-problem-tp4019857.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Persistence in fireUntilHalt() loop
by Alberto R. Galdo
Hi,
We're running an application that uses Drools + JBPM 5 + Drools
integration our set-up can be seen as:
Some rule fires and creates a JBPM process ( a fact gets inserted into
drools using "kcontext.getKnowledgeRuntime().startProcess("testProcess")"
). We have a problem with the persistence of this processes. Persistence is
implemented with JPA and JTA. Our application runs with fireUntilHalt() and
when a process is launched from the consequence of any of the rules the
persistence of the process fails. If the application runs with
fireAllRules(), the persistence works like a charm.
The error shown is as follow:
Exception in thread "Thread-5" Exception executing consequence for rule
"Run Process" in com.sample: java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1101)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1229)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:754)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:730)
at
org.drools.command.runtime.rule.FireUntilHaltCommand$1.run(FireUntilHaltCommand.java:50)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at
org.jbpm.persistence.processinstance.JPAProcessInstanceManager.addProcessInstance(JPAProcessInstanceManager.java:44)
at
org.jbpm.process.instance.AbstractProcessInstanceFactory.createProcessInstance(AbstractProcessInstanceFactory.java:36)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:182)
at
org.jbpm.process.instance.ProcessRuntimeImpl.createProcessInstance(ProcessRuntimeImpl.java:154)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:135)
at
org.jbpm.process.instance.ProcessRuntimeImpl.startProcess(ProcessRuntimeImpl.java:130)
at
org.drools.common.AbstractWorkingMemory.startProcess(AbstractWorkingMemory.java:1074)
at
org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(StatefulKnowledgeSessionImpl.java:301)
at com.sample.Rule_Run_Process.defaultConsequence(Rule_Run_Process.java:9)
at com.sample.Rule_Run_ProcessDefaultConsequenceInvoker.evaluate(Unknown
Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
... 6 more
The problem is in this function:
public void addProcessInstance(ProcessInstance processInstance) {
ProcessInstanceInfo processInstanceInfo = new ProcessInstanceInfo(
processInstance, this.kruntime.getEnvironment() );
ProcessPersistenceContext context
= ((ProcessPersistenceContextManager)
this.kruntime.getEnvironment()
.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER ))
.getProcessPersistenceContext();
// @PrePersist added to ProcessInstanceInfo because of this
context.persist( processInstanceInfo );
((org.jbpm.process.instance.ProcessInstance)
processInstance).setId( processInstanceInfo.getId() );
processInstanceInfo.updateLastReadDate();
internalAddProcessInstance(processInstance);
}
We think after that persist sentence, the entity manager would have to run
a flush sentence for the process instance is inserted into database and get
the ID.
Greets.
13 years, 6 months
Re: [rules-users] exception jitting problem
by Mario Fusco
brendanneff wrote
>
> I read a few forum posts about updating to 5.4 CR1 (we're using 5.4
> Final), but wanted to ask and see if that's really the cause before I
> start changing the version. I also saw that casting as an Integer, which
> we do, could solve the problem. Could someone take a look at this and let
> me know if changing to CR1 would fix the issue or if there's a simpler
> solution?
>
I am afraid you misread some former email. I think nobody wrote (or at least
I couldn't find it) that using the 5.4.CR1 release instead of the 5.4.Final
could fix this problem. Quite the opposite actually. I fixed some of these
jitting issues we had between the CR1 and the Final and some others
(including the one you found) remained even in the Final release.
I think I've fixed all the outstanding jitting issues and these fixes will
be available in the upcoming 5.5 release (we are deploying the beta1 in
these days). However it would be great if I could reproduce the bugs you
found, both because I could check if they are actually fixed in the 5.5 and
possibly give you some more informed suggestions to workaround them in the
5.4. In order to do that, the only info I miss is how the CMVNewLoanBean
class is made. Could you please send its source code (or at least the parts
relevant for the 2 failing rules you have) ?
brendanneff wrote
>
> Here are the rules that seem to be causing the errors:
>
> rule "Cashcure - Average Monthly Income Less Than 1251"
> when
> $loan : CMVNewLoanBean( new
> Integer(getCustomer().getLatestEmployer().monthlySalary) < 1251)
> then
> $loan.setLenderError($loan.getCurrentLender().getName(), 20253);
> end
>
Out of curiosity, why do you create the new Integer there instead of just
doing:
CMVNewLoanBean( getCustomer().getLatestEmployer().monthlySalary < 1251)
Thanks for reporting this,
Mario
--
View this message in context: http://drools.46999.n3.nabble.com/exception-jitting-problem-tp4019763p401...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
System problems
by paco
I am using Drools 5.4.0, guvnor 5.3.0 and default database.
I imported the rules with XML file (550 KB) in Guvnor. After I can check,
validate and test (with run analysis button) the rules without problems.
Everything works fine.
After when I import ed other rules XML file (30,000 KB), I realized that the
system becomes too slow and obviously I can no longer veifier, validate or
test my rules.
Please suggest
--
View this message in context: http://drools.46999.n3.nabble.com/System-problems-tp4018363.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Adding .package files to a KnowledgePackage
by Paul Ryan
So drools will respect files with a .package extension as a place for declared types, functions, etc. when used with these in the class path. How can a import these into a KnowledgePackage/KnowledgeBase so they can get compiled along with stuff when this is not in the class path at startup? My use case is such that these are not in the same space and can't be loaded at startup time in most cases.
Any help is greatly appreciated,
-- Paul Ryan
13 years, 6 months
Changing the java compiler level in drools
by balaji.govindarajulu
I want to change the java compiler level to 1.6 but it doesn't seem to work
for me. I am trying to use generics in the consequence part.
Following is my code that I used to change the compiler level.
*Drools Version: 5.2.1 GA
JDK Version : 1.6*
*final Properties properties = new Properties();
properties.setProperty("drools.dialect.java.compiler", "JANINO");
properties.setProperty("drools.dialect.default", "java");
properties.setProperty("drools.compiler.lnglevel", "1.6");
PackageBuilderConfiguration packageBuilderConfiguration =
new PackageBuilderConfiguration(properties,(ClassLoader[]) null);
final KnowledgeBuilder knowledgeBuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder(packageBuilderConfiguration);*
Let me know where I am going wrong.
Thanks for the help.
--
View this message in context: http://drools.46999.n3.nabble.com/Changing-the-java-compiler-level-in-dro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months