Re: [rules-users] Drools and ArrayList
by wendy
I think normally setGlobal variables are only used when you want to be able
to call back out to the java code again. (I'm not an expert by any stretch
so please take that with a grain of salt.) So you might be able to just
insert the list.
I'm going to assume the List is really List<NombersUnTypeDefault> if that is
not true please let me know.
what about something like this? First is collects all the
NombersUnTypeDefault that match your constraints from list then it counts
them using an accumulate function.
global java.util.List list
rule "Calcul redondance"
when
$i: Number() from accumulate($c: NombersUnTypeDefault()
from collect(NombersUnTypeDefault($code ==
"AAA", $int == 1) from list)
, count($c));
then
System.out.println($i);
end
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-and-ArrayList-tp3140821p3144161....
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
How do we use a huge collection in the condition of a rule
by Prasad
Hi All,
Is there a way in which we can use a collection in the condition of a rule
(to be used in contains, memberof) , which can be managed by a Guvnor User
containing big list of elements (may be 10,000).
Having this in a Database is an option but considering the maintenance of
the list where in a user(who doesn't have Database Knowledge) has to update
the list frequently, can this collection be maintained in Guvnor and used in
the Condition of a rule.
Thanks,
Prasad
--
View this message in context: http://drools.46999.n3.nabble.com/How-do-we-use-a-huge-collection-in-the-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Re: [rules-users] How to change database configuration from derby to oracle?
by Michael Anstis
HI Deepak,
You never did answer my question:
Can you create new rules when configured to use Oracle? If so your
configuration, I'd assume, to be correct. AFAIK the repository folder is
only relevant if you're using JCR's file-system storage - if configured to
use a database I doubt it has much relevance. So you'll need to export the
repository XML first (your comment above implied you know how) from Derby,
re-configure for Oracle and import.
With kind regards,
Mike
2011/7/6 Deepak Cherukuri <deepak.cherukuri(a)valuemomentum.biz>
> Dear All,****
>
> Firstly, before deploying the Drools guvnor in weblogic11g , I set the
> repository configuration in components.xml.below is the path i mentioned for
> repositoryConfiguration****
>
> <component name="repositoryConfiguration">
> <property name="homeDirectory">E:/GuvnorRepo/</property>****
>
> Deployed the Drools guvnor in weblogic11g , and in E drive GuvnorRepo
> folder has created with 3 sub folders workspaces,repository,version and
> repository.xml.
> Now i updated the repository.xml for changing the database from derby to
> oracle.
> Below are the changes
> <PersistenceManager
> class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager">
>
> <param name="driver" value="oracle.jdbc.driver.OracleDriver"/>
> <param name="url" value="jdbc:oracle:thin:@rsa10gserver:1525:ifpub34"/>
> <param name="user" value="drools_repository"/>
> <param name="password" value="drools_repository"/>
> <param name="schema" value="oracle"/>
> <param name="schemaObjectPrefix" value="version_"/>
> <param name="tableSpace" value=""/>
> <param name="errorHandling" value=""/>
> </PersistenceManager>****
>
> Now i restarted the weblogic11g and it successfully deployed and entered
> into the login page and but i could not see any rules in the left navigation
> page.****
>
> Is there any other procedure rather than what I have done?****
>
> Whether I should import/export new repository.xml ?****
>
> Please help me regarding this.****
>
> ** **
>
> ** **
>
> *Thanks & Regards*
>
> * *
>
> *Deepak Cherukuri* | Software Engineer****
>
> Value Momentum Software Services Pvt Ltd(SEZUnit),****
>
> HitechCity2, Gachibowli(V)****
>
> Hyderabad 500 081****
>
> deepak.cherukuri(a)valuemomentum.biz ****
>
> Cell: +91 95537 - 95999****
>
> http://www.valuemomentum.com****
>
> [image: cid:image003.jpg@01CA595B.191D0A30]****
>
> ** **
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
13 years, 4 months
How to change database configuration from derby to oracle?
by Deepak Cherukuri
Dear All,
Firstly, before deploying the Drools guvnor in weblogic11g , I set the
repository configuration in components.xml.below is the path i mentioned for
repositoryConfiguration
<component name="repositoryConfiguration">
<property name="homeDirectory">E:/GuvnorRepo/</property>
Deployed the Drools guvnor in weblogic11g , and in E drive GuvnorRepo folder
has created with 3 sub folders workspaces,repository,version and
repository.xml.
Now i updated the repository.xml for changing the database from derby to
oracle.
Below are the changes
<PersistenceManager
class="org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManage
r">
<param name="driver" value="oracle.jdbc.driver.OracleDriver"/>
<param name="url" value="jdbc:oracle:thin:@rsa10gserver:1525:ifpub34"/>
<param name="user" value="drools_repository"/>
<param name="password" value="drools_repository"/>
<param name="schema" value="oracle"/>
<param name="schemaObjectPrefix" value="version_"/>
<param name="tableSpace" value=""/>
<param name="errorHandling" value=""/>
</PersistenceManager>
Now i restarted the weblogic11g and it successfully deployed and entered
into the login page and but i could not see any rules in the left navigation
page.
Is there any other procedure rather than what I have done?
Whether I should import/export new repository.xml ?
Please help me regarding this.
Thanks & Regards
Deepak Cherukuri | Software Engineer
Value Momentum Software Services Pvt Ltd(SEZUnit),
HitechCity2, Gachibowli(V)
Hyderabad 500 081
<mailto:deepak.cherukuri@valuemomentum.biz>
deepak.cherukuri(a)valuemomentum.biz
Cell: +91 95537 - 95999
<http://www.valuemomentum.com/> http://www.valuemomentum.com
cid:image003.jpg@01CA595B.191D0A30
13 years, 4 months
Absence Pattern question
by wendy
Hi,
I'm having trouble writing an absence pattern. What I'm trying to do is
detect when there is an A followed by no Bs for 3+minutes. I don't care if
there is more than one A. What I'm running into is that when I try to use
'over window:time' the time within drools is the end time of the window. So
this means I need to write the no Bs for 3+ min first:
not( $b: B() over window:time(3m))
then try to find the A before it:
$now: Long() from RuleUtilityFunctions.getSessionClockTime()
$a: A( this before [3m] $now)
then I should have to check to make sure that I don't have any Bs between
$a's time and the start of the no B window:
not( B( time >= $a.time,
time <= $now))
This is not working. I think that it has something to do with my function
to get the session clock time (RuleUtilityFunctions.getSessionClockTime())
and how things get evaluated within the Rete engine. Because it does not
seem like $now is getting re-evaluated on future calls that pass the $b
condition. If I replace $now with the call to getSessionClockTime()
everything just seems to get weird.
I've tried to write the rule forward too. Look for A followed by no B but
that does not seem to work because A is matched at the current time and the
rule triggers because there is no B because the future B data has not be
inserted into working memory yet.
What is the right way to write this rule? Is there a way to get the start
and end time of the time window that met the over window:time() condition?
Thank you,
Wendy
--
View this message in context: http://drools.46999.n3.nabble.com/Absence-Pattern-question-tp3140377p3140...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
Drools Clustering
by dan.dobrescu
Hi,
I've searched the forum, but I couldn't find nothing useful about my
question..
I've got a little problem.. So, I've implemented in Drools some rules,
mostly triggered by two external events... EVENTA, and EVENTB. My
applications is clustered, so it's possible that EVENTA is inserted from
NODE1 and EVENTB from NODE2. But in this case, I'll have different facts in
both sessions, and it's possible that my rules don't fire. Has drools
implemented clustering for statefull sessions? or how should I do, because
if both session are containing the same facts, the rules will be triggered
twice... I'd like a behavior similar to Quartz..
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Clustering-tp3140305p3140305.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
org.hibernate.exception.LockAcquisitionException: could not delete:
by Jose
Hi All,
When i tried to execute the rule in multi threaded environment, i got
the below mentioned Error logs...
I just tried to execute the rule flow with 2 thread, always 1 got executed
successfully and one fails with the following error log.
ERROR LOG:
Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?
Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?
2011/07/04 11:20:06.475{UTC} [JDBCExceptionReporter :
JDBCExceptionReporter.java: logExceptions: 100] [RMI TCP
Connection(6)-10.50.53.32]: WARN: : SQL Error: 60, SQLState: 61000
2011/07/04 11:20:06.475{UTC} [JDBCExceptionReporter :
JDBCExceptionReporter.java: logExceptions: 101] [RMI TCP
Connection(6)-10.50.53.32]: ERROR: : ORA-00060: deadlock detected while
waiting for resource
2011/07/04 11:20:06.475{UTC} [AbstractFlushingEventListener :
AbstractFlushingEventListener.java: performExecutions: 324] [RMI TCP
Connection(6)-10.50.53.32]: ERROR: : Could not synchronize database state
with session
org.hibernate.exception.LockAcquisitionException: could not delete:
[org.drools.persistence.processinstance.ProcessInstanceInfo#8130]
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:112)......
Thanks,
Jose.
--
View this message in context: http://drools.46999.n3.nabble.com/org-hibernate-exception-LockAcquisition...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months
check whether a key is present in global Map, i.e. mimicking containsKey() behavior
by esstrata
Hello,
I'm using Drools 5.1.1 in a JavaSE 6 project.
I can't get running a rule where a value obtained from WM is check for
existence as a key of a global Map.
I have a map of the type ProductTextCode -> Product, where keys are String
and values Product
/global Map productMap/
Then in a rule a I want a condition where each String in WM is tested
against map keyset.
/
rule "Product ID not in products map"
dialect "mvel"
when
$pid : String()
=> Here goes the condition <=
then
System.out.println("Invalid product id: " + $pid)
retract ($pid)
end
/
So far I've tried with productMap.containsKey($pid) but a get a MVEL error
as it takes 'containsKey' as a property.
Please help. Thank you.
--
View this message in context: http://drools.46999.n3.nabble.com/check-whether-a-key-is-present-in-globa...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 4 months