BuildError: Unable to resolve ObjectType
by BS
Hi all,
I'm quite new to Drools and have a problem with the guided editor of the
Eclipse plugin. I'm using Drools 5.0.1.
These are the two BuildErrors for "TestGuided.brl" in Eclipse:
1) BuildError: Unable to build expression for 'consequence': Failed to
compile: 1 compilation error(s): - (1,1) unqualified type in strict mode
for: p ' update( p );
2) BuildError: Unable to resolve ObjectType 'Produkt'
In "drools.package" I have all necessary imports and also the package
statement. This is the BRL source of "TestGuided.brl":
<rule>
<name>TestGuided</name>
<modelVersion>1.0</modelVersion>
<attributes/>
<metadataList/>
<lhs>
<fact>
<factType>Produkt</factType>
<boundName>p</boundName>
</fact>
</lhs>
<rhs>
<modify>
<fieldValues/>
<variable>p</variable>
</modify>
</rhs>
</rule>
When I use the generated DRL output of the guided editor in a DRL file, I do
not get any error message. The DRL file looks like this and compiles
perfectly in Eclipse:
package com.test
rule "TestGuided"
dialect "mvel"
when
p : Produkt( )
then
update( p );
end
Adding the BRL from above to Guvnor does not throw any error. The BRL
validates and compiles perfectly in Guvnor.
So, why is it only in the guided editor of Eclipse not working but in the
guided editor of Guvnor as well as DRL file? Maybe something in my
configuration is errorneous?
Any help is appreciated, many thanks
Bernd
--
View this message in context: http://n3.nabble.com/BuildError-Unable-to-resolve-ObjectType-tp702633p702...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years
Blurring the lines of jBPM and Drools
by keithnielsen
I have been researching both jBPM and Drools for sometime now and am
wondering what the future holds for jBPM. This is based on my research of
Drools 5, which is bringing what I would consider more BPM constructs into
the core engine, things such as Wait States, Human Tasks, etc. One of the
main things I don't see yet is the whole persistence and support of long
running processes. My question is will the trend with Drools continue,
eventually consuming jBPM?
I must say that my perception is that Drools is more active which makes me
wonder if I should go with Drools hoping that it builds out more BPM
features going forward.
Thanks
--
View this message in context: http://www.nabble.com/Blurring-the-lines-of-jBPM-and-Drools-tp20099731p20...
Sent from the drools - user mailing list archive at Nabble.com.
14 years, 1 month
Resuming a simple process involving human task
by Touma
Hi all,
For the past few weeks I've been trying to get a simple drools flow example
involving human tasks up and running. I've done quite a bit to the point
that my session, process, task and workitems are being persisted in the
database. Here is what my flow looks like:
Start -> Ruleflow -> Decision node -> Human Task -> Printing Node -> End
The work item handler for the Human task simply performs the task of
persisting the Task instance. After reaching the Human Task, the flow stops
and the state is persisted. But how would I go about restarting/resuming the
flow so that the 'Printing node' is reached? I've tried using the
loadStatefulKnowledgeSession(sessionId) to load the session but querying the
list of all the processes for the given session returns an empty list. Ditto
with the list of all the process events. I have all the ID's with me
(workitem, process, task, session) but am pretty confused as to how these
can be put to use to resume my suspended workflow.
Any pointers would be much appreciated. TIA.
Peace,
/T\
--
View this message in context: http://n3.nabble.com/Resuming-a-simple-process-involving-human-task-tp716...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 1 month
Chained Rules
by djb
Hi all,
I know there are some basic ways to chain rules together, by setting flags
in consequences that are checked in the conditions of other rules...
but in a large system based on rule templates, where thousands of rules are
generated, it is not feasible to chain rules in this manner, especially when
they are chained in a somewhat arbitrary fashion
(eg. True if Rule 130 AND Rule 200 AND Rule 480 fire)
has anyone had this situation before? would I need to execute this as a
post-processing step? or, is there any design pattern that will allow rules
to be chained, preferably in a manageable way?
regards,
Daniel
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Chained-Rules-tp77549...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 2 months
creating .pkg from .drl
by Amit Kumar
Hi Folks,
I am trying to create a .pkg file (for probably faster loading) from a .drl
file
Does anybody has a code snippet which I can use. Am unable to find it in
javadocs.
Thanks
Amit
14 years, 3 months
KnowledgeAgent and OSGI
by mmarmol
Hi, I have managed to install Drools-core and Drools-compiler in my Equinox
osgi environment, I can compile rules and execute them just fine, I was just
wandering how to configure a KnowledgeAgent using
KnowledgeBuilderFactoryService and KnowledgeBaseFactoryService. I managed to
configure one but i am not able to reload rules when they change at runtime.
I have started ResourceChangeScannerService and
ResourceChangeNotifierService, changeset related to the rules file gets read
but no change gets implemented. An idea?
Here is the code:
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
ServiceReference serviceRef = bc
.getServiceReference(ServiceRegistry.class.getName());
ServiceRegistry registry = (ServiceRegistry) bc.getService(serviceRef);
KnowledgeBuilderFactoryService knowledgeBuilderFactoryService = registry
.get(KnowledgeBuilderFactoryService.class);
KnowledgeBaseFactoryService knowledgeBaseFactoryService = registry
.get(KnowledgeBaseFactoryService.class);
ResourceFactoryService resourceFactoryService = registry
.get(ResourceFactoryService.class);
KnowledgeBuilderConfiguration kbConf = knowledgeBuilderFactoryService
.newKnowledgeBuilderConfiguration(null, getClass()
.getClassLoader());
KnowledgeBuilder kbuilder = knowledgeBuilderFactoryService
.newKnowledgeBuilder(kbConf);
ResourceFactoryService resource = resourceFactoryService;
kbuilder.add(resource.newFileSystemResource(filePath),
ResourceType.CHANGE_SET);
if (kbuilder.hasErrors()) {
System.out.println(kbuilder.getErrors());
throw new RuntimeException(kbuilder.getErrors().toString());
}
KnowledgeBaseConfiguration kbaseConf = knowledgeBaseFactoryService
.newKnowledgeBaseConfiguration(null, getClass()
.getClassLoader());
KnowledgeBase kbase = knowledgeBaseFactoryService
.newKnowledgeBase(kbaseConf);
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.scanDirectories", "true");
aconf.setProperty("drools.agent.scanResources", "true");
aconf.setProperty("drools.agent.newInstance", "false");
kagent = KnowledgeAgentFactory.newKnowledgeAgent( "CoreDroolsAgent",kbase,
aconf);
kagent.applyChangeSet(resource.newFileSystemResource(filePath));
Thanks in advance!
Cheers
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/KnowledgeAgent-and-OS...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 3 months
Failed to read schema document when trying to transform from XML to DRL
by Chang Liu
Hi there,
Error message:
(null: 5, 77): schema_reference.4: Failed to read schema document 'drools.org/drools-5.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
I ran into this issue when experimenting a project that transforming the rules back and forth from DRL to XML with utility classes as documented in following link:
http://downloads.jboss.com/drools/docs/5.0.1.26597.FINAL/drools-expert/ht...
My code:
...
XmlPackageReader xmlReader = new XmlPackageReader(null);
StringReader sr = new StringReader(rulesInXml);
try {
PackageDescr packageDescr = xmlReader.read(sr);
DrlDumper drlDumper = new DrlDumper();
String drlString = drlDumper.dump(packageDescr);
}
catch (Exception ex) {
System.out.println(ex);
}
...
where string "rulesInXml" is the result xml string transformed from a valid .drl file. It looks like:
<?xml version="1.0" encoding="UTF-8"?>
<package name="com.sample"
xmlns="http://drools.org/drools-5.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0 drools.org/drools-5.0.xsd">
<import name="com.sample.DroolsTest.Message" />
<rule name="Hello World">
<lhs><pattern identifier="m" object-type="Message" >
<field-constraint field-name="status">
<qualified-identifier-restriction evaluator="==">Message.HELLO </qualified-identifier-restriction>
</field-constraint>
<field-binding field-name="message" identifier="myMessage" />
</pattern>
</lhs>
<rhs> System.out.println( myMessage );
m.setMessage( "Goodbye cruel world" );
m.setStatus( Message.GOODBYE );
update( m );
</rhs>
</rule>
<rule name="GoodBye">
<lhs><pattern object-type="Message" >
<field-constraint field-name="status">
<qualified-identifier-restriction evaluator="==">Message.GOODBYE </qualified-identifier-restriction>
</field-constraint>
<field-binding field-name="message" identifier="myMessage" />
</pattern>
</lhs>
<rhs> System.out.println( myMessage );
</rhs>
</rule>
</package>
What did I miss here?
Moreover, the Drools 5.0 API's for XML support are poorly-documented. For example, the constructors of class "XmlPackageReader" has an arg of "SemanticModules" type which is not documented. :(
Any help would be highly appreciated!
Thanks,
Chang
**********************************************************************
CONFIDENTIALITY NOTICE: The information contained in this email is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the intended recipient, you are hereby notified that any unauthorized review, use, dissemination, distribution or copying of this communication is prohibited and may be subject to legal restriction or sanction. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of the information and all copies. If you are the intended recipient but do not wish to receive communications through this medium, please advise the sender immediately. Thank you
14 years, 3 months
Timers' Week :)
by nanic23
Alright... two more:
1. If a process suspends, do timers keep running/firing?
2. Let's say I have workItem_1 --> workItem_2 --> workItem_3 of which
"workItem_1" suspends the flow and "workItem_3" has a timer. After reloading
the StatefulKnowledgeSession and completing "workItem_1" and moving on do I
need to restart the timer for "workItem_3"?
I would like to mention some inconsistent behavior I have experienced:
- ksession.fireUntilHalt() is not starting the timers, instead
ksession.fireAllRules() DOES.
- ksession.halt() does not stop the timers (if that is the way I'm supposed
to stop them)
Any tips or personal experience will be very appreciated.
Thanks,
Nick.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Timers-Week-tp912807p...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 4 months