Initial rule delay
by Paul R.
Hi,
I'm looking for a way to delay a rules initial execution? In the following
example, I would like to prevent the rule from firing when the first "Foo"
event is inserted into the working memory.
rule "DelayTest" when $n : Number() from accumulate( $f : Foo() over
window:time(10s) count($f) ) then // bla end
The timer attribute seems to almost support what I'm looking for, i.e. it
allows for an initial-delay to be specified; but if the repeat interval is
omitted, it uses the initial delay as the repeat interval.
timer ( int: <initial delay> <repeat interval>? )
In my case I would like to block the execution of the rule for an
"initial-delay" period, but after that time has elapsed the rule should
fire when every time a new "Foo" event is inserted into the working memory.
What is the recommended way to do this?
Thanks & Regards,
Paul
14 years, 1 month
guvnor repo with Oracle issue
by jnorris
Hi All,
I'm trying to get the drools-guvnor web-app (5.4.0.Final) to work with
Oracle. I ran the admin tool to create the repository XML file and when the
app is started the tables are created and some data is put into some of
them. However I get an error message "400 sorry, technical error occurred".
The server.log file shows that an error occurred. The first part of the
stack trace is this:
13:32:48,421 INFO [stdout] (http-localhost-127.0.0.1-8080-5) INFO 05-06
13:32:48,406 (DemoAuthenticator.java:authenticate:65) Demo login for user
(admin) succeeded.
13:32:48,640 WARN [org.jboss.seam.security.permission.SecurityRuleLoader]
(http-localhost-127.0.0.1-8080-5) No security rules configured - rule base
permissions will be unavailable.
13:32:48,984 INFO [stdout] (http-localhost-127.0.0.1-8080-3) INFO 05-06
13:32:48,984 (RulesRepositoryConfigurator.java:getInstance:46) Creating an
instance of the RulesRepositoryConfigurator.
13:32:51,484 INFO [stdout] (http-localhost-127.0.0.1-8080-3) ERROR 05-06
13:32:51,484 (ConnectionHelper.java:doTry:462) Failed to execute SQL
(stacktrace on DEBUG log level)
13:32:51,484 INFO [stdout] (http-localhost-127.0.0.1-8080-3)
java.sql.SQLSyntaxErrorException: ORA-00955: name is already used by an
existing object
13:32:51,484 INFO [stdout] (http-localhost-127.0.0.1-8080-3)
So next I tried importing the repository that is included in the
jbpm-installer. This time I get the error "unable to import into the
repository". I think this part of the log is where that occurred:
13:36:28,921 INFO [stdout] (http-localhost-127.0.0.1-8080-2) Clearing rules
repository
13:36:33,859 INFO [stdout] (http-localhost-127.0.0.1-8080-2) ERROR 05-06
13:36:33,859 (BundleWriter.java:writeState:248) Error while storing blob.
id=b27ba97b-1b3d-4069-88af-d9ea5f504e8d/{http://www.jboss.org/drools-repo...
idx=0 size=28659
13:36:33,859 INFO [stdout] (http-localhost-127.0.0.1-8080-2)
java.lang.IllegalStateException: Unable to insert index for string:
binaryContent
13:36:33,859 INFO [stdout] (http-localhost-127.0.0.1-8080-2) at
org.apache.jackrabbit.core.persistence.pool.NGKDbNameIndex.insertString(NGKDbNameIndex.java:66)
and this a bit further down:
13:36:33,875 INFO [stdout] (http-localhost-127.0.0.1-8080-2) Caused by:
java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert
NULL into ("DROOLS_JCR_USR"."PM_WS_DEFAULT_NAMES"."ID")
13:36:33,875 INFO [stdout] (http-localhost-127.0.0.1-8080-2)
13:36:33,875 INFO [stdout] (http-localhost-127.0.0.1-8080-2) at
oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
I have set the heap size higher to get rid of the out of memory exception as
mentioned in another post.
The full server log and respository.xml file is attached.
http://drools.46999.n3.nabble.com/file/n4017760/serverlog.zip serverlog.zip
I'd appreciate any ideas on how to resolve this.
Cheers,
Jim
--
View this message in context: http://drools.46999.n3.nabble.com/guvnor-repo-with-Oracle-issue-tp4017760...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
calling a function before and after every rule
by Hezi Stern
Hi All,
I would like to add timestamps printout during entrance and exit of each
rule.
Is there a way to write function so that it will run before and after every
rule without needing to specifically add it to all rules?
Regards,
Hezi
14 years, 1 month
@PropertyReactive optimizations broken when using 'this' keyword
by mikegai
I'm getting activations that I shouldn't when using the 'this' keyword on
@propertyReactive objects. Here's a simplified example:
package bug
dialect "mvel"
declare Monkey
@propertyReactive
name:String
emotion:String
hot : boolean
end
declare Barrel
@propertyReactive
topMonkey:Monkey
end
rule "Initial Facts" when
then
monkey =new Monkey("Thomas","sad", false)
insert (monkey)
insert (new Barrel(monkey))
insert (new MonkeySuit(monkey, false))
end
//This will loop forever even it shouldn't (it's not modifying any of the
properties in the constraint)
//To fix, reinstate the watch annotation below to correct the watched
property list
rule "When a monkey is on top and his name is Thomas he should be made
happy" when
Barrel($monkey: topMonkey)
Monkey(this==$monkey, name=="Thomas" ) //@watch(!*,name)
then
System.out.println($monkey.getName() + " should be happy!")
modify ($monkey) {
setEmotion("happy")
}
end
It's only when using the "this" keyword. Apparently it is including the
"this" in the inferred property watch list since when I clear the watch list
and rebuild it correctly using the @watch annotation, all works fine.
Has the "this" keyword been deprecated? I can't see any sign that it has so
this appears to be a bug. For now I'm getting it to work by matching my
facts on unique Ids instead of "this" but "this" is handier when an Id
property is unavailable.
--
View this message in context: http://drools.46999.n3.nabble.com/PropertyReactive-optimizations-broken-w...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
modify keyword cancels activation unexpectedly
by gboro54
I am using drools 5.4 and am running into a weird issue with using modify
keyword. I have have two rules, both are similar in conditions(one rule
catches 2 additional cases to modify the object with a generic message).
Weather I add the checks for each rule into the into the generic rule or
have a condition checking the object for the more specific messages to be
added, the modify keyword seems to ignore this. In the case where the
conditions are added to the generic rule independent the activation is
cancelled. Any thoughts? I do have property reactive on...
--
View this message in context: http://drools.46999.n3.nabble.com/modify-keyword-cancels-activation-unexp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
Guvnor 5.4 CR1 role based authentication with JBossAS 7
by bhochhi
Hello,
Has anybody successfully set up the role based authentication on Guvnor 5.4
CR1 hosted on Jboss AS7? I tried all possible way I could think of but in
vain. I modified bean.xml(commented <security:IdentityImpl> in whole and
uncommented <security:jaas.JaasAuthenticator> and
<guvnorSecurity:RoleBasedPermissionResolver> ). I also replaced
code="UsersRoles" for <security-domain name="other" cache-type="default">
under <login-module> in standalone.xml. Could anyone please help me how to
configure role-based authentication for guvnor based on properties files? Is
was so obvious on 5.3 or former. But this new 5.4 looks so different.
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-5-4-CR1-role-based-authenticatio...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month
Guvnor WS Constraints not getting activated
by Kannan Murali
Hi,
I tried to add field constraints to the condition and action columns in my
rules. I am using a Decision table (Web guided editor) to input my rules.
Even after adding the constraints I was able to save rules that violated
them. I read in another post that working sets have to be activated
manually. I dont see any option to do that. I am using Guvnor version
5.4.0.Final. Attaching the screenshots of the constraint and the new rule.
Thanks
Kannan
14 years, 1 month
Drools Decision Table, multiple actions accumulation
by chsekhar
I am doing a similar example as described in this example in the link from
jboss website and go the section "6.1.3. How Decision Tables Work". (I have
attached the image as well)
http://drools.46999.n3.nabble.com/file/n4017733/example_decision_table.png
http://docs.jboss.org/drools/release/5.2.0.Final/drools-expert-docs/html/...
Drools documentation
In the example they are populating a "list" in the ACTION. So if a fact
matches couple of rows in the decision table, the list would contain those
two items.
My requirement is I need to have key value pair(Map) as my rule
consequence(ACTION). I was able to do one action which has "key,value" in a
single column and I was able to work with that. I am trying to find out if i
can have these values in two columns separately in the excel. (My key
actually contains 3 values and combining this with value looks messy. ex:
k1,k2,k3,value. So if can put the value in a separate column it would be
great)
I tried to create a global variable and called setter methods on separate
columns, but the problem is the setters in both the columns(ACTION) run
independently whereas I had to put both of them in a map which would mean I
should be able to pass the value present in both the columns in one method
call.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Decision-Table-multiple-actions-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 1 month