JRules to Drools migration
by massios
Dear all,
I am interested to find out how easy/hard it would be to migrate rules from
IBM WebSphere JRules to Drools. I understand this would involve a
considerate amount of effort for the migration, testing and deployment of
the rules.
Is there a tool that can help with the migration of at least the rule
constructs so that we can concentrate our attention with testing the
automigration and with the migratiion the code invoking the rule engine?
Thanks in advance,
Nikos
--
View this message in context: http://drools.46999.n3.nabble.com/JRules-to-Drools-migration-tp3769164p37...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 9 months
Filtering inside the LHS
by Hezi Stern
Hi All,
I am seeking some kind of filtering (if statement) inside the LHS.
I have the following example rule (note: $attributeFilteredSentences and
$cmdescriptor are defined in the extends rule which is not presented):
rule " choose message sentence example" extends " attributeFilteredSentences
collection"
when
SContextState(state == SContextState.ONE)
$sentences: ArrayList()
from collect (Sentences.Sentence(
descriptor.meanings.meaning == $cmdescriptor.meanings.meaning
) from
$attributeFilteredSentences)
then
logger.info("RULE: entered rule: "+drools.getRule().getName());
//some logic.
end
as can be seen I am filtering sentences based on the meanings, and the
meaning collection must be identical as in $cmdescriptor (this is the case
when SContextState.ONE)
Now to my question: I have cases ((this is the case when SContextState.TWO)
where I do not need exact validation but rather superset of (for this I have
a supersetOf operator implemented)
I would like to avoid duplicating this rule (as I have similar condition in
many other rules) and being able to filter once with "==" and once with
"supersetOf" depending on the SContextState.
Any ideas how to do this?
Thanks,
Hezi
12 years, 9 months
Bug with BatchExecutionHelper when using Log4j rootlogger?
by dunnlow
Hi,
I have a small drools client that sends a pojo to a Drools Server using
xstream:
MyBean mb = new MyBean();
List<Command> cmds = new ArrayList<Command>();
InsertObjectCommand insertCmd = (InsertObjectCommand)
CommandFactory.newInsert(mb);
insertCmd.setOutIdentifier("inserter");
insertCmd.setEntryPoint("Default");
cmds.add(insertCmd);
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
cmds.add(fireAllRulesCommand);
BatchExecutionCommand command =
CommandFactory.newBatchExecution(cmds,"ksession1");
String xml BatchExecutionHelper.newXstreammarshaller().toXML(command); *<--
this XML is sent to the server*
..........8<
Pretty standard, I think. It works just fine and I get a http 200 response
back from my server.
HOWEVER, if I add log4j (log4j.1.2.14.jar) and a log4j.properties that has a
root logger (set to any level) the XML produced includes an "appenderList"
which seems to be trying to stream the log4j appenders (e.g.
org.apache.log4j.ConsoleAppender). I'm guessing these are not serializable
(no surprise there) and the server complains about the XML. (fyi, the same
log4j jar is on the drools server)
Is this a known issue/expected? I can comment out the root logger and
everything is back to ok.
Thanks for any insight,
-J
--
View this message in context: http://drools.46999.n3.nabble.com/Bug-with-BatchExecutionHelper-when-usin...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 9 months
Declared model and drools.agent.newInstance
by Juanker Atina
Hi there,
I want to work with declared facts, inside drl file, but when i set
drools.agent.newInstance
property to false, it seems that drools won't work with this specific fact.
My code stops working when i put this two lines,
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.newInstance", "false");
And it works fine when i remove these lines.
So, I've read that this property is related to new instances of
KnowledgeBase when resources changes...
c&p from: http://grepcode.com/file/repository.jboss.org/maven2/org.drools/
drools-api/5.0.0.M4/org/drools/agent/KnowledgeAgentFactory.java
*aconf.setProperty( "drools.agent.newInstance",
"true" ); // resource changes results in a new
instance of the KnowledgeBase being built,
// this cannot currently be set to
false for incremental building*
Hence, why is this property changing the behaviour of the rules?
(See this thread too,
http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-v...
)
12 years, 9 months