jbrms with tomcat security realm
by hongyu lu
Hi,
Just wonder if anyone has had experience with setting up jbrms security with tomcat realms(memory realm is good enough in our case). Was unable to find an example from the doc/web.
thanks!
Jeff
16 years, 2 months
Sessions, WorkingMemory, Long lived facts
by David Sinclair
I have a question concerning facts. I have a service based application
XML IN -> Business Objects -> Rule Processing -> Business Objects -> XML OUT
Pretty straightforward.
In the rule processing I will lazily load objects into WorkingMemory that
drive some of the business rules. For instance, if a new Windows
Server(Business Object) is installed, ensure its OS is only Windows Server
2007 (lazily loaded DB object).
What I would like to do is be able to either preload the working memory with
this data, or preferably, lazily load the data. So my question is how do you
place facts into working memory when you create a new session each time
without having to assert them everytime? Or this that a stupid
question...Should the question be, since working memory/sessions aren't
thread safe, i.e. one can't be shared by everyone, what is the best way to
place long lived facts into memory of all sessions?
thanks
dave
16 years, 2 months
Re: [rules-users] Re: drools 5.0.0-SNAPSHOT Maven repository broken! please fix!
by tim tim
the maven list found the solution see here:
http://www.nabble.com/mvn2-url-resolution-for-SNAPSHOT-sources-wrong-ts19...
from brett porter on the maven list:
> '.' is not a valid separator for snapshots - it needs to be -SNAPSHOT.
> Drools will need to redeploy it as 5.0.0-SNAPSHOT for it to work.
best, tim
On Wed, Oct 8, 2008 at 6:35 PM, Geoffrey De Smet
<ge0ffrey.spam(a)gmail.com> wrote:
>
> With kind regards,
> Geoffrey De Smet
>
>
> tim tim schreef:
>>
>> hi
>>
>> when i am getting drools snapshot via "mvn eclipse:eclipse"
>> the compiled drools jars are downloaded but the sources are not, although
>> i have
>> <downloadSources>true</downloadSources>
>> defined as parameter in my pom.xml and the sources of the other libraries
>> are downloaded correctly.
>> when i use drools 4.0.7 those sources are downloaded correctly.
>>
>> i can find the sources manually in the http://snapshots.jboss.org/maven2
>> repository, they are just not downloaded
>> automatically.
>>
>> i deleted the |mvn-eclipse-cache.properties |file in my target directory
>> before calling mvn. (see
>> http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html)
>
> Doesn't "mvn eclipse:clean" delete that cache too?
>
>>
>> an extract from my maven output:
>>
>> // the compiled jars are located correctly:
>> ..
>> [INFO] snapshot org.drools.solver:drools-solver:5.0.0.SNAPSHOT: checking
>> for updates from snapshots.jboss.org <http://snapshots.jboss.org>
>> [INFO] snapshot org.drools.solver:drools-solver:5.0.0.SNAPSHOT: checking
>> for updates from repo1.maven.org <http://repo1.maven.org>
>> Downloading:
>> http://snapshots.jboss.org/maven2/org/drools/solver/drools-solver/5.0.0.S...
>> 1K downloaded
>> Downloading:
>> http://snapshots.jboss.org/maven2/org/drools/drools-compiler/5.0.0.SNAPSH...
>> 943K downloaded
>> Downloading:
>> http://snapshots.jboss.org/maven2/org/drools/drools-core/5.0.0.SNAPSHOT/d...
>> 1547K downloaded
>> Downloading:
>> http://snapshots.jboss.org/maven2/org/drools/solver/drools-solver-core/5....
>> 94K downloaded
>> ...
>> // but maven searches for the sources in the wrong repositories:
>>
>> Downloading:
>> http://repository.jboss.org/maven2/org/drools/drools-compiler/5.0.0.20081...
>> Downloading:
>> http://repo1.maven.org/maven2/org/drools/drools-compiler/5.0.0.20081008.1...
>> Downloading:
>> http://repo1.maven.org/maven2/org/drools/drools-compiler/5.0.0.20081008.1...
>> Downloading:
>> http://repository.jboss.org/maven2/org/drools/drools-core/5.0.0.20081008....
>> Downloading:
>> http://repo1.maven.org/maven2/org/drools/drools-core/5.0.0.20081008.10280...
>> Downloading:
>> http://repo1.maven.org/maven2/org/drools/drools-core/5.0.0.20081008.10280...
>> ...
>>
>> does someone else have this problem?
>>
>> or maybe my pom.xml is wrong?
>> the relevant parts of my pom.xml file are:
>>
>> <repositories>
>> <repository>
>> <id>repo1.maven.org <http://repo1.maven.org></id>
>
> I don't think you need to explicitly add this one, it's always automatically
> added, unless you overwrite it with the id "central" I think.
>>
>> <url>http://repo1.maven.org/maven2</url>
>> <snapshots>
>> <enabled>true</enabled>
>
> repo1.maven.org doesn't contain snapshots as far as I know, so it should be
> false
> It could be that the eclipse plugin only searches on the first snapshot repo
> it encounters? Which version of the eclipse plugin are you using?
>>
>> </snapshots>
>> <releases>
>> <enabled>true</enabled>
>> </releases>
>> </repository>
>> <repository>
>> <id>repository.jboss.org <http://repository.jboss.org></id>
>> <url>http://repository.jboss.org/maven2</url>
>> <snapshots>
>> <enabled>false</enabled>
>> </snapshots>
>> <releases>
>> <enabled>true</enabled>
>> </releases>
>> </repository>
>> <repository>
>> <id>snapshots.jboss.org <http://snapshots.jboss.org></id>
>> <url>http://snapshots.jboss.org/maven2</url>
>> <snapshots>
>> <enabled>true</enabled>
>> </snapshots>
>> <releases>
>> <enabled>false</enabled>
>> </releases>
>> </repository>
>> </repositories>
>>
>> <dependencies>
>> <dependency>
>> <groupId>janino</groupId>
>> <artifactId>janino</artifactId>
>> <version>2.5.10</version>
>> </dependency>
>> <dependency>
>> <groupId>org.drools</groupId>
>> <artifactId>drools-core</artifactId>
>> <version>5.0.0.SNAPSHOT</version>
>> </dependency>
>> <dependency>
>> <groupId>org.drools</groupId>
>> <artifactId>drools-compiler</artifactId>
>> <version>5.0.0.SNAPSHOT</version>
>> </dependency>
>> <dependency>
>> <groupId>org.drools.solver</groupId>
>> <artifactId>drools-solver-core</artifactId>
>> <version>5.0.0.SNAPSHOT</version>
>> </dependency>
>> </dependencies>
>>
>> unfortunately i have no idea what the problem might be and installing the
>> sources manually every time i update is no very attractive option..
>>
>>
>> thanks in advance, tim
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
16 years, 2 months
Unable to load dialect java from Ant task
by Soterro
Hi all,
I have a perfectly running Eclipse 3.3 with DRools 4.0.4 and JDK 1.5.14.
The rules are compiled with a post build Ant task which uses Janino (need it for Tomcat compatibility).
Now OUTSIDE Eclipse it seems I cannot use that Ant task to save my life :(
I tried switching from Janino to the default compiler, same thing. I always get this infamous error:
BUILD FAILED
E:\buildRules-hudson.xml:30: RuleBaseTask failed: Unable to load dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
at com.csc.ezbook.eztarif.rules.DroolsCompilerAntTaskStandalone.execute
(DroolsCompilerAntTaskStandalone.java:163)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java
:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
[...]
Caused by: org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
at org.drools.compiler.PackageBuilderConfiguration.addDialect(
PackageBuilderConfiguration.java:152)
at org.drools.compiler.PackageBuilderConfiguration.
buildDialectConfigurationMap(PackageBuilderConfiguration.java:140)
at org.drools.compiler.PackageBuilderConfiguration.init(
PackageBuilderConfiguration.java:117)
at org.drools.compiler.PackageBuilderConfiguration.<init>(
PackageBuilderConfiguration.java:94)
at com.my.app.rules.DroolsCompilerAntTaskStandalone.getPackageBuilder(
DroolsCompilerAntTaskStandalone.java:257)
at com.my.app.rules.DroolsCompilerAntTaskStandalone.execute(
DroolsCompilerAntTaskStandalone.java:136)
That "DroolsCompilerAntTaskStandalone" is my task using the default compiler like this:
PackageBuilderConfiguration conf = new PackageBuilderConfiguration();
conf.setClassLoader( loader );
PackageBuilder builder = new PackageBuilder( conf );
If I use Janino like below the error is exactly the same...
PackageBuilderConfiguration pkgBuilderCfg = new
PackageBuilderConfiguration();
pkgBuilderCfg.setClassLoader( loader );
JavaDialectConfiguration javaConf = (JavaDialectConfiguration)
pkgBuilderCfg.getDialectConfiguration( "java" );
javaConf.setCompiler( JavaDialectConfiguration.JANINO );
PackageBuilder builder = new PackageBuilder( pkgBuilderCfg );
Again, in Eclipse all is working fine. I checked Ant's classpath, here it is:
E:\apache-ant-1.7.0\bin\..\lib\ant-launcher.jar
E:\apache-ant-1.7.0\lib\*.jar
C:\Program Files\Java\jdk1.5.0_14\lib\tools.jar
Here is how I provide a classpath:
<taskdef name="rulescompiler" classname="com.my.app.rules.
DroolsCompilerAntTaskStandalone" classpathref="droolsutils.classpath" />
<target depends="newfilesarethere" name="build" unless="rulesCompile.
notRequired">
<rulescompiler srcdir="${THIS_PROJ}/src/com/my/app/rules"
tofile="${THIS_PROJ}/build/classes/com/my/app/rules/
packaged.rules"
classpathref="droolsutils.classpath" >
<include name="*.drl" />
</rulescompiler>
</target>
The classpath I provide contains pretty much all libraries I use normally in the project, but I tried even to add ALL jar's from the Eclipse 3.3 install directory (that would include all DRools 4.0.4 libraries, with antlr and whatnot)
I tried also with DRools 4.0.7, same behaviour...
What does that mean and where is it coming from? Could it have issues with the tools.jar from Java 1.5.0_14?
Thank you for any input,
M
16 years, 2 months
drools solver move factory crash
by tim tim
hello
the new version of the drools-solver supports multiple move factories.
i happily split my move factory to take advantage of the
relativeSelection parameter.
now the problem is that not all move factories can produce moves for
every possible
current solution. and the
org.drools.solver.core.localsearch.decider.selector.MoveFactorySelector
crashes, when a move factory does not return a single move.
public final List<Move> selectMoveList(StepScope stepScope) {
List<Move> moveList =
moveFactory.createMoveList(stepScope.getWorkingSolution());
if (shuffle) {
Collections.shuffle(moveList, stepScope.getWorkingRandom());
}
if (relativeSelection != null) {
int selectionSize = (int) Math.ceil(relativeSelection *
moveList.size());
if (selectionSize == 0) {
selectionSize = 1;
}
moveList = moveList.subList(0, selectionSize); // <--
CRASH, if moveList is empty
}
return moveList;
}
currently i solve it by always returning at least a "null-move".
but a better solution would be to change the
MoveFactorySelector.selectMoveList(), so that it tests for an
empty list.
best, tim
16 years, 2 months
No globals in functions?
by Bagwell, Allen F
There's probably an easy explanation for this. I was wondering about why functions inside of rule files can't access globals?
For example, I have a log4j logger that I pass into my rule files via a global. The logger should never be a part of working memory. It's just there to capture valuable feedback.
But I can't do this:
global Logger log;
function void foo(String cond)
{
if (cond == "error")
log.error("I saw an error");
}
Because the compiler says that in the function it can't resolve 'log'.
-A
Allen F. Bagwell
e-mail: afbagwe(a)sandia.gov
phone: 505/284-4517
fax: 505/ 844-7886
There is no monument dedicated to the memory of a committee. -- Lester J. Pourciau
16 years, 2 months
Drools Rule Analytics Module
by Ralph Jeffery
Hi
I have been looking at the QA Analysis feature in Guvnor, which I
think is the Rule Analytics Module, and was wondering if this feature
is available from Eclipse?
Regards
Ralph
16 years, 2 months
Search a keyword in xml file content using jcr:contains() query in jackrabbit
by Mohamed Riyaz
Hi,
In jackrabbit, How to search a keyword in a xml file using jcr:contains()
Xpath query without interfering xml node?
Eg: I have a content property in a blog entry node 'book'. content is
represented as xml file (<*j2ee*>Introduction to x design pattern</*j2ee*>).
If I search a word 'j2ee', its returning the node which is not currect
conceptually.
Please suggest me the possible approch either to use 'regular expression' or
alternative way to resolve this requirement.
//Keyword search
StringBuffer queryStr = *new* StringBuffer();
queryStr.append("//book[jcr:contains(@bookContent,'");
queryStr.append("j2ee");
//queryStr.append("j??e");
queryStr.append("')]");
Query query = queryManager.createQuery(queryStr.toString(), Query.*XPATH*);
QueryResult queryResult = query.execute();
Regards, Riyaz
16 years, 2 months
Removing history from JBRMS
by Richard Ambridge
Hi,
In drools-jbrms all history information is kept, which is great for
when we are in production to track changes.
However, during development we perform a lot of changes and tests with
the repository.
Is there anyway to remove the history information from the repository?
Cheers
Ric
16 years, 2 months
Changing the default character for delimiter in decision tables
by Vikrant Yagnick
Hi All,
I wanted to throw to discussion a feature that might be good in Drools. I am basically trying to model a formula evaluator in a decision table. The idea being that a business user directly defines formulas(without having to use Guided Editors in the BRMS or Eclipse, as business users love Excel more than anything else..;)).
The thing I am trying to do is the following:
Condition Action
T:FormulaFact
formulaName int salary=t.getSalary();
t.setBenefit($1);
Formula1 salary * 100
Formula2 salary * 1000
Everything runs great as Excel simply substitutes the entered string into the function. The problem I face is when I write something like this:
Formula3 min(salary,100)
The "," here is treated as the delimited of a parameter. So the compiled DRL does not set the string correctly. It would make a rule like
Rule FormulaTable_123
When
T: FormulaFact(formulaName="Formula1")
Then
int salary=t.getSalary();
t.setBenefit(min(salary); //Since the words after the , become part of $2 which is not defined.
End
Is there any-way to declaratively change the Decision Table Parser to not use , for delimiting between parameters and use some other character.
I could always write the DT using my character, then compile the DT into DRL and replace my character with ,(I am thinking of using "Colon"), but would it be a good idea to have an Excel or a Property File that can be read by the SpreadSheetCompiler to change the delimited character used by the Parser.
Cheers,
Vikrant
MASTEK LTD.
Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCOMASTEK
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16 years, 2 months