Decision table and DSL
by philippe rouxel
Hi,
My project is multi-national: the business model is in english, but
some rules depend on the user's country (fr, de).
This rules have to be edited in the locale language.
For editing a rule, the guided rule editor and a DSL are fine.
But for a decision table, I did not find a way to use a DSL.
So, what is the best strategy:
+ use a template for each DT and loose the benefits of sharing the translation.
+ use an expander for each DT that parse a DSL and translate the terms.
Or may be an other solution?
Thanks,
Philippe
14 years, 9 months
"from" keyword does not actually check types?
by Jevon Wright
Hi,
I am using Drools 4.0.7, and I had a DRL rule similar to the following:
rule "..."
when
other : Foo( )
x : Bar( ) from other.property
then
...
end
An unexpected bug occured. In some situations, other.property would _not_ be
of type Bar, yet Drools would still think that it was. As a result I was
getting some unusual exceptions being thrown: "org.mvel.CompileException:
unable to resolve property: ..."
If I changed the rule to:
x : Bar( ) from other.property
eval ( x instanceof Bar )
It would instead throw a ClassCastException (i.e. "Baz cannot be cast into
Bar").
If, instead, I changed the rule to:
x : Bar( other.property == x )
It would start working correctly, and 'x' would only be of type Bar.
Is this known behaviour? Is it expected? If so, I would appreciate it if the
4.0.7 documentation was updated to reflect that "from" actually ignores the
return type of properties. It took me a couple of hours to detect and fix
this bug.
I would try these rules in Drools 5.x, but I'm still waiting for the
blocking JBRULES-2218 to be resolved.
Cheers
Jevon
14 years, 10 months
Drools Flow / Declarative process definition
by Jaroslav Pullmann
Dear Drools team,
I like much the approach of Drools Flow and would appreciate to learn more.
The documentation states the extended rule engine having knowledge of the process model
and instance state derives the next process execution step. I am wondering, whether the
overall flow is reactive, even the procedural constructs like sequence, branching/joining
are implemented through firing rule actions ? For example, does Drools Flow converts the
sequence of steps A -> B into sth. like "when A.passed then B.start()" ?
When the prevoius holds, does Drools Flow allows to create (desgin) and execute declarative processes
omiting any explicit sequencing ? The steps/tasks were ordered partially by data- or event-based
dependency conditions or even activated independently of each other.
Drools Flow/Expert provide a thight integration with Java (e.g. representing facts as Java classes).
Are there future plans for supporting a higher-level processing with XML/XPath/XQuery like in YAWL ?
Many thanks
Jaro
--
Jaroslav Pullmann
Web Compliance Center - Fraunhofer FIT
Schloss Birlinghoven, D-53757 Sankt Augustin, Germany
Phone: +49-2241-142623 Fax: +49-2241-142065
14 years, 10 months
Process with subprocesses don't continue after finish work items in the subprocesses
by Dirk
Hey Drools-Users,
I've got a big and urgent problem with my drools process. I have a complex
process with many decisions and subprocesses. These subprocesses could even
contains more subprocesses so that i have a four-level flow.
I testet each subprocess isolated in a mock environment and now i get my
problem when they are combined in a big "super-process". I create the
process with the JPAKnowledgeService (and VariablePersistenceStrategy) and
everything works as expected. The process execute some actions, a
validation-subprocess and another subprocess with a human task (with a
custom handler). The process stops and persist all the variables (except
Integers; Must be a bug?). Perfect. Now I load the session with the
JPAKnowledgeService and complete the workitem with the
ksession.getWorkItemManager().completeWorkItem method. The subprocess now
execute to the end and then the engine stopps without an error. But there
are more steps in the superprocess todo. All subprocesse are "independent =
true" with "wait for completion = true" and don't have timers.
Has anybody an idea? Is this a known problem? I'm using the last
successfully build form the 21.02.2010. Do you need the process? (Then i
have to remove some internal information and could post it...)
Many thanks in advance
Dirk
--
View this message in context: http://n3.nabble.com/Process-with-subprocesses-don-t-continue-after-finis...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 10 months
Using DeadLines in Human Task
by ramram
Hi All,
I am trying to use the DeadLine option in the human task but I am having
the following exception once trying to run the task: I am trying to run the
task from the eclipse. Any Ideas????
[2010:02:55 13:02:118:exception] Uncaught exception on client
org.apache.mina.filter.codec.ProtocolDecoderException:
org.apache.mina.core.buffer.BufferDataException:
java.io.InvalidClassException: failed to read class descriptor (Hexdump:
...........)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:231)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:431)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$5(DefaultIoFilterChain.java:426)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:787)
at
org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:431)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:423)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:635)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:595)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:584)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$7(AbstractPollingIoProcessor.java:581)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:966)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:61)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.apache.mina.core.buffer.BufferDataException:
java.io.InvalidClassException: failed to read class descriptor
at
org.apache.mina.core.buffer.AbstractIoBuffer.getObject(AbstractIoBuffer.java:1984)
at
org.apache.mina.filter.codec.serialization.ObjectSerializationDecoder.doDecode(ObjectSerializationDecoder.java:92)
at
org.apache.mina.filter.codec.CumulativeProtocolDecoder.decode(CumulativeProtocolDecoder.java:178)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:221)
... 15 more
Caused by: java.io.InvalidClassException: failed to read class descriptor
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at java.util.ArrayList.readObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at
org.apache.mina.core.buffer.AbstractIoBuffer.getObject(AbstractIoBuffer.java:1982)
... 18 more
Caused by: java.lang.ClassNotFoundException:
org.hibernate.PersistentObjectException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.apache.mina.core.buffer.AbstractIoBuffer$3.readClassDescriptor(AbstractIoBuffer.java:1962)
... 42 more
--
View this message in context: http://n3.nabble.com/Using-DeadLines-in-Human-Task-tp412870p412870.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 10 months
KnowledgeAgent
by Jeffrey Schneller
Can someone explain how to use the knowledge agent when the rules are
stored on the guvnor. I also do not want to use an xml configuration
file [change-set] to specify the url of the guvnor. The url is
retrieved through the code in my case and I can't set it via a
change-set since we don't know what the url is until runtime.
Thanks.
14 years, 10 months
Unable to pipeline Jms TEXT messages
by Adam Sussman
I am getting the following error:
org.apache.activemq.command.ActiveMQTextMessage cannot be cast to
javax.jms.ObjectMessage
at org.drools.runtime.pipeline.impl.JmsUnwrapMessageObject.receive(JmsUnwrapMessageObject.java:18)
at org.drools.runtime.pipeline.impl.BaseEmitter.emit(BaseEmitter.java:31)
at org.drools.runtime.pipeline.impl.StatefulKnowledgeSessionPipelineImpl.insert(StatefulKnowledgeSessionPipelineImpl.java:40)
at org.drools.runtime.pipeline.impl.JmsMessenger$JmsMessengerRunner.run(JmsMessenger.java:133)
at java.lang.Thread.run(Thread.java:619)
When trying to build the following pipeline to take pure TEXT messages
off of a JMS queue and pass them to Smooks for transformation:
KnowledgeRuntimeCommand insertStage =
PipelineFactory.newStatefulKnowledgeSessionInsert();
// Smooks transform
Smooks smooks = new
Smooks(getClass().getResourceAsStream("smooks-config.xml"));
Transformer transformerStage =
PipelineFactory.newSmooksFromSourceTransformer(smooks, "foo");
transformerStage.setReceiver(insertStage);
// Object deserialization
Action unwrapObjectStage = PipelineFactory.newJmsUnwrapMessageObject();
unwrapObjectStage.setReceiver(transformerStage);
// Pipeline entry stage
Pipeline entry =
PipelineFactory.newStatefulKnowledgeSessionPipeline(ksession);
entry.setReceiver(unwrapObjectStage);
// JNDI lookup for the JMS queue is here. Its an ActiveMQ provider
Service messenger = PipelineFactory.newJmsMessenger(entry,
props, "myqueue", null);
Now I know someone will say "just send objects through JMS", but that
won't work here. The endpoint sending the messages is not Java and
can't build java object encodings. In fact, the endpoint is the JMS providers'
own native own C++ library (ActiveMQ), so we are stuck with a pure
text message.
Is there any way to have other kinds of message unwrappers for a Jms pipeline?
I would be happy to roll my own, but I am pretty unclear on how to plug one in.
Any help would be appreciated.
-adam
14 years, 10 months