Bug in "not" ???
by Tom.E.Murphy@wellsfargo.com
Using Drools Expert 5.0.1
The following rule fires both when the "not" is there, and also if the "not" is commented out. Clearly, both cannot be true, so there is something wrong somewhere.
I've narrowed it down to the testing of the $parentEmploymentId declaration - the AccountHolder CE, which is inside the context of the "not", is referencing $parentEmploymentId, which is declared outside the "not".
If the indicated line is commented out, then the expression behaves sensibly (i.e. fires either when the "not" is used, or when it isn't, but not both). However, an important business semantic element is then missing from the rule.
Is this a bug in Drools, or am I misusing something?
rule "RS7713.9.2_"
when
Employment ( $parentEmploymentId : myId )
not # if the not is commented out, the rule still fires!!!!
(
AccountHolder
(
$parentEmployerInfoId : myId
, parentId == $parentEmploymentId # if this line is commented, it behaves sensibly (per the 'not'), but misses an important business semantic
)
and
BusinessName
(
parentId == $parentEmployerInfoId
, lines contains "DISTRESS"
)
)
then
;
end
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 515 423 4334
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
15 years, 11 months
Smooks Data Loader uses
by JNaylies
Hi all,
I'm new in drools development and I would like toload datas with Smooks Data
Loader.
Unfortunately, I do not find a lot of example of uses.
My need is to load datas from proprietary format and i do not understand all
mechanism.
So, I would thanks you a lot to help me to find good example or good
documentation about this.
Best regards
Jérôme
Ps : sorry for my poor English
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Smooks-Data-Loader-us...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
how "exists" works exactly?
by Antonio Neto
Hi all,
I don't know exactly why I have a problem in my "exists" function. I've
tried many different ways, but it does not work. Anybody could help me,
please?
I have the following rules:
*rule "diff"
when
$var1: EReference(name == "employee")
$var2: EClass(name == "Company", EAllReferences contains $var1)
not (exists( EPackage(EClassifiers contains $var2 ) ))
then
insertLogical(new IntConstraintOccurrence("diff", 10));
end
rule "ClassesNotReferenced"
when
$q1 : EClass();
$q2 : EPackage(EClassifiers contains $q1);
not( exists ( EReference(EType == $q1) ));
then
insertLogical(new IntConstraintOccurrence("ClassesNotReferenced", 1,
$q1));
end*
and in my facts (and my EPackage) I have 4 instances of EClass "Company"
with a EReference "employee", and another EClass "Person". I still have a
"move" that removes EClasses in my Drools Solver.
I need to have only one classe "Company" after processing. But it removes
only the EClass "Person", when it was supposed to remove one EClass "Person"
and 3 ECLasses "Company". Leaving one EClass "Company" in the end.
The problem is: when Drools tries to remove a EClass "Person" it thinks
that the EClass "Company" does not exists. But in fact there are 3 others.
Any clue about it, please ?
Thanks
Bests regards
Antonio
15 years, 11 months
Need Sample Java Code
by ashok kumar
Hi Team,
I need sample java code that on Drools v5.0.. can anyone share the rule XML
file format along with the sample code
that fires the rules defined in XML? Do i need to save the file with
'.xml' extension or it will be XML data in .drl file?
Please throw some light on this..
Thanks,
JFly.
15 years, 11 months
expert: usage of ruleflow-groups
by Miguel Machado
Hi there,
I'm having some trouble implementing the desired workflow of rule firing in an application using drools expert. I've read the thread about the difference between ruleflow groups and agenda groups, but it is still unclear to me how to achieve what i need.
What i intend to have is the ability to fire a specific set of rules according to the object i'm inserting into the ksession.
I do not want to use agenda-groups because it stacks all the agenda groups declared on the rule file (as far as i understand) and therefore it may fire activations i do not want to be fired. Instead, i want to isolate them completely. I tried using ruleflow groups for this, but i cannot find a way to activate a specific group programmatically, before calling fireAllRules(), the way i can with agenda-groups (setFocus() method).
That being said, i'm asking for help in trying to use either one of ruleflow/agenda groups or even both in order to get things working the way i described.
Thanks in advance,
_ miguel
15 years, 11 months
Can NOT map variable to "User Task" in BPMN2
by nanic23
Hi All,
1. I have the following BPMN2 flow.
http://n3.nabble.com/file/n780238/flow.jpg
2. With a String type flow variable called "firstName".
http://n3.nabble.com/file/n780238/props.jpg
3. "Work Handler" has a WorkItemHandler behind it that just prints out the
value of "firstName". Variable "firstName" is mapped in "Parameter Mapping".
4. "User Task" is a Human Task node with just a regular WorkItemHandler
behind it that as well just prints out the value of "firstName". There is NO
Mina Server involvement, just a common WorkItemHandler. Variable "firstName"
is mapped in "Parameter Mapping".
5. "Finished Script" just access "firstName" directly.
Results:
1. "Work Handler" executes just fine and prints the value of "firstName".
2. "Finished Script" executes just fine and prints the value of "firstName".
3. "User Task" can NOT find "firstName" and shows the following error:
http://n3.nabble.com/file/n780238/error1.jpg
Comments:
1. I don't believe it is a mapping problem as I have declared the variable
at the flow level and mapped it accordingly to each node. Is not a typo
error either as I checked that like more than 100 times :)
2. I have the same example in a Ruleflow (.rf) instead of BPMN2 (.bpmn) and
it works just fine.
Questions:
1. Is there any difference in mapping in variables to a "User Task" node in
BPMN2 vs Ruleflow? Specially when not using the Mina Server and just
registering a regular WorkItemHandler?
2. Do I have to declare any kind of "scope" for the variable? "Work Handler"
doesn't seem to have any problems and doesn't complain about "scope".
3. Any other ideas why the WorkItemHandler behind "User Task" cannot find
"firstName"?
I appreciate any comments or ideas.
Thanks,
Nick.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Can-NOT-map-variable-...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 11 months
Error running Drools example : org.drools.WorkingMemory not found
by devyani.sapre@wipro.com
Hi
I am new to Drools (using version 4.0.7). I download eclipse workbench
and am trying to run the default example in it. But I get the following
error
java.lang.NoClassDefFoundError: org/drools/WorkingMemory
When I looked at the drools-core jar; It seems to be missing
WorkingMemory package. What should I do?
Using eclipse version 3.4.0.
Thanks
Devyani
Please do not print this email unless it is absolutely necessary.
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
15 years, 11 months
FIXED: Changing Guvnor PresistantManager to MSSQL
by eyal edri
OK,
after changing the default workspace.xml file PersistantManager to also
MSSQL settings,
things look a lot better... (created another tables on Drools db).
thanks :)
Eyal.
On Wed, May 5, 2010 at 2:52 PM, eyal edri <eyal.edri(a)gmail.com> wrote:
> Getting there..
>
> I've manged to make drools find the jdbc.jar and even start successfully!!
> :)
> so it auto-created some VERSION_x tables in the Drools DB.
>
> the conf i'm using is: (diff driver + url)
>
> <PersistenceManager
> class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
> <param name="driver" value="
> com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
> <param name="url" value="
> jdbc:sqlserver://my-sql:1433;databaseName=Drools;"/>
> <param name="schema" value="mssql"/>
> <param name="user" value="sa"/>
> <param name="password" value="xxx"/>
> <param name="schemaObjectPrefix" value="${wsp.name}_"/>
> <param name="externalBLOBs" value="false"/>
> </PersistenceManager>
>
>
> now, when i tell him to create a new sample project it fails with:
>
> 14:39:45,497 INFO [STDOUT] ERROR 05-05 14:39:45,496
> (RulesRepositoryAdministrator.java:clearRulesRepository:79)
> javax.jcr.RepositoryException: /: unable to update item.:
> 17528b92-d60d-48cf-82dd-7c9654effe34: 17528b92-d60d-48cf-82dd-7c9654effe34
> 14:39:54,217 INFO [STDOUT] ERROR 05-05 14:39:54,216
> (RepositoryServiceServlet.java:doUnexpectedFailure:62)
> org.drools.repository.RulesRepositoryException:
> javax.jcr.InvalidItemStateException: /: the item cannot be saved because it
> has been modified externally.
>
> ideas?
>
>
> On Wed, May 5, 2010 at 2:32 PM, eyal edri <eyal.edri(a)gmail.com> wrote:
>
>> OK,
>>
>> some progress,
>>
>> i found out that the versioning section was casuing the problem, so i
>> changed
>> <param name="schemaObjectPrefix" value="${wsp.name}_"/>
>> to <param name="schemaObjectPrefix" value="version_"/>
>>
>> now i get an exception about not finding the jdbc driver.
>>
>> Caused by: java.lang.ClassNotFoundException:
>> com.microsoft.jdbc.sqlserver.SQLServerDriver
>>
>> i put sql-jdbc.2.0.jar which i use in all my java apps in the class path
>> (/usr/lib and also in the lib dir of the jboss server). with no luck.
>>
>> is there another jar i should use for this driver?
>>
>> attached is the new stacktrace..
>>
>> thanks,
>>
>> Eyal.
>>
>> On Wed, May 5, 2010 at 2:08 PM, eyal edri <eyal.edri(a)gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I'm a drools newbie, and i'm trying to connect GUVNOR to MSSQL.
>>> I've followed the guide and changed repository.xml as follows (the rest i
>>> left unchanged from the default repository.xml):
>>>
>>> <Workspace name="${wsp.name}">
>>> <FileSystem
>>> class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
>>> <param name="path" value="${wsp.home}"/>
>>> <PersistenceManager
>>> class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
>>> <param name="driver"
>>> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>>> <param name="url"
>>> value="jdbc:microsoft:sqlserver://my-sql:1433;;DatabaseName=Drools;SelectMethod=Cursor;"/>
>>> <param name="schema" value="mssql"/>
>>> <param name="user" value="sa"/>
>>> <param name="password" value="xxx"/>
>>> <param name="schemaObjectPrefix" value="${wsp.name}_"/>
>>> <param name="externalBLOBs" value="false"/>
>>> </PersistenceManager>
>>> ....
>>>
>>> </Workspace>
>>>
>>> and versioning also:
>>>
>>> <Versioning rootPath="${rep.home}/version">
>>>
>>> <PersistenceManager
>>> class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
>>> <param name="driver"
>>> value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
>>> <param name="url"
>>> value="jdbc:microsoft:sqlserver://my-sql:1433;;DatabaseName=Drools;SelectMethod=Cursor;"/>
>>> <param name="schema" value="mssql"/>
>>> <param name="user" value="sa"/>
>>> <param name="password" value="xxx"/>
>>> <param name="schemaObjectPrefix" value="${wsp.name}_"/>
>>> <param name="externalBLOBs" value="false"/>
>>> </PersistenceManager>
>>> </Versioning>
>>>
>>>
>>>
>>> - i'm running a standalone GUVNOR package.
>>> - i created an empty Drools db in my server: my-sql
>>> - I deleted all the repository dir content
>>> - i'm getting a few exceptions:
>>>
>>> ERROR [[/drools-guvnor]] Exception sending context initialized event to
>>> listener instance of class org.jboss.seam.servlet.SeamListener
>>> org.jboss.seam.InstantiationException: Could not instantiate Seam
>>> component: repositoryConfiguration
>>>
>>> (attached is the full stacktrace)
>>>
>>> can anyone help?
>>>
>>>
>>> --
>>> Eyal Edri
>>>
>>
>>
>>
>> --
>> Eyal Edri
>>
>
>
>
> --
> Eyal Edri
>
--
Eyal Edri
15 years, 11 months
Changing Guvnor PresistantManager to MSSQL
by eyal edri
Hi,
I'm a drools newbie, and i'm trying to connect GUVNOR to MSSQL.
I've followed the guide and changed repository.xml as follows (the rest i
left unchanged from the default repository.xml):
<Workspace name="${wsp.name}">
<FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}"/>
<PersistenceManager
class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
<param name="driver"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<param name="url"
value="jdbc:microsoft:sqlserver://my-sql:1433;;DatabaseName=Drools;SelectMethod=Cursor;"/>
<param name="schema" value="mssql"/>
<param name="user" value="sa"/>
<param name="password" value="xxx"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
<param name="externalBLOBs" value="false"/>
</PersistenceManager>
....
</Workspace>
and versioning also:
<Versioning rootPath="${rep.home}/version">
<PersistenceManager
class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
<param name="driver"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver"/>
<param name="url"
value="jdbc:microsoft:sqlserver://my-sql:1433;;DatabaseName=Drools;SelectMethod=Cursor;"/>
<param name="schema" value="mssql"/>
<param name="user" value="sa"/>
<param name="password" value="xxx"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
<param name="externalBLOBs" value="false"/>
</PersistenceManager>
</Versioning>
- i'm running a standalone GUVNOR package.
- i created an empty Drools db in my server: my-sql
- I deleted all the repository dir content
- i'm getting a few exceptions:
ERROR [[/drools-guvnor]] Exception sending context initialized event to
listener instance of class org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component:
repositoryConfiguration
(attached is the full stacktrace)
can anyone help?
--
Eyal Edri
15 years, 11 months
Getting an Error While Executing Rule in Drools 5.0
by Nikhil S. Kulkarni
Hi,
I have compiled some rules and added it in packages. Then I serialized those packages and stored in database in the form of CLOB data
Now I am able to get Packages back from database and loaded it in RuleBase.
But while executing Rule, I am getting the following Exception.
java.lang.NullPointerException
at org.drools.base.ClassFieldReader.getValue(ClassFieldReader.java:91)
at org.drools.base.evaluators.EqualityEvaluatorsDefinition$StringEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1962)
at org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:92)
at org.drools.rule.OrCompositeRestriction.isAllowed(OrCompositeRestriction.java:25)
at org.drools.rule.MultiRestrictionFieldConstraint.isAllowed(MultiRestrictionFieldConstraint.java:97)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:143)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1046)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1001)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:788)
at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:201)
The similar kind of issue is already logged by someone.
Please inform If anyone has an idea about this.
Waiting for Reply.
Thanks & Regards,
Nikhil S. Kulkarni
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 years, 11 months