Jervisliu | 1 Dec 2009 03:31
Picon
Favicon

Re: How to store the rules data into RDBMS, like mysql, oracle

A quick Google search indicated that this is probably a JackRabbit 
issue, see [1]. Did not dig deeper to see if this issue has been fixed 
in JackRabbit. You may want to find it out by yourself. One workaround 
is to replace ${wsp.name <http://wsp.name>} with "default".

[1]. 
http://mail-archives.apache.org/mod_mbox/jackrabbit-dev/200601.mbox/%3C004701c61db2$244cb970$b6fdfe0a <at> gkaradimitr%3E

Cheers,
Jervis Liu

Sinboy Zhang wrote:
> Hi,all:
>    Guvnor is a BRMS,it can manage the rules through Jackrabbit 
> Repository.The default,Guvnor work well with derby database.But i want 
> it work with my database,just like MySQL.
> My step is :
>   1.Run Guvnor with default,and generate the repository.xml and 
> repository dictionary at JBOSS_HOME\bin dictionary
>   2.delete repository dictionary and edit repository.xml,only replace 
> the content in <PersistenceManage> label ,just like this:
>     <PersistenceManager 
> class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
>        <param name="driver" value="com.mysql.jdbc.Driver"/>
>        <param name="url" value="jdbc:mysql://localhost:3306/guvnor_db"/>
>        <param name="user" value="root" />
>        <param name="password" value="a123456" />
>        <param name="schema" value="mysql"/>
>        <param name="schemaObjectPrefix" value="${wsp.name 
> <http://wsp.name>}_"/>
(Continue reading)

Jervisliu | 1 Dec 2009 03:48
Picon
Favicon

Re: Import and Export at Package level

I am afraid a per-package based import/export is not supported yet in 
Guvnor. Create a Jira and vote for it. Though the quickest way is to 
create a Jira and summit a patch for it;-)

Cheers,
Jervis

krishna.cj wrote:
> Hi,
>
> We are running Guvnor on two machines, out of which one is used for  
> developing and testing rules, say test environment, and another is  
> used for providing rules for production application. Our test  
> environment typically contains more than one package and each in turn  
> contains multiple snapshots. When we use Export  and Import  to  
> provide updated rules to production environment,  all the packages and  
> snapshots are imported to the production environment.
> Is there any way to use Export and Import at package level so that we  
> can export only the package we want and no other package or snapshot?
>
> Any help would be a great help to us..
>
> Best Regards,
> Chaitanya.
> _______________________________________________
> rules-users mailing list
> rules-users <at> lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>   

(Continue reading)

Jervisliu | 1 Dec 2009 06:37
Picon
Favicon

Re: Drools with Web Application

Deepak Jambhekar wrote:
> Hi Jervisliu,
>
>        I have a similar case where in I need to integrate Guvnor to 
> one of my web application which is developed in Struts Framework... 
> Can you pls suggest me how can I do this?
> .
This depends on what Guvnor functions you want to call from your web 
application. And you want to call them from your server side application 
or from your client side. The easiest way is to expose Guvnor through 
your own servlets. You need to write some servlets, put them in 
Guvnor.war. An alternative is to expose Guvnor through RESTful 
interface, eg., Atom/Pub based. The current version of Guvnor provides a 
preliminary support of Atom/Pub. For example, you can find a RSS icon on 
Asset widget. Using that RSS URL, your application can do some simple 
interactions with Guvnor server such as subscribing to change history 
etc. However as I said this is only a "preliminary" support, we are 
still far from a fully "RESTfulized" Guvnor. If you are interested in 
this approach, please take a look into Guvnor SOA project [1]. This 
project is still under prototyping phase, but the Atom/Pub interface 
part is almost done. SVN is [2].

[1]. http://www.jboss.org/guvnor/
[2]. https://svn.jboss.org/repos/guvnor/trunk

Jervis

Another approach which I think is the
> Deepak Prabhakar Jambhekar
>
(Continue reading)

mardo | 1 Dec 2009 09:12
Picon

BaseMinaClient - Session Termination

Hello,

I have a simple RuleFlow containing a Human Task, which I start using the
following lines of code:

			WSHumanTaskHandler wsh = new WSHumanTaskHandler();
	
ksession.getWorkItemManager().registerWorkItemHandler("Human Task", wsh);
			ksession.startProcess("com.sample.ruleflow");

When the workflow has properly ended however, there remain threads (e.g.
NioProcessor&NioSocketConnector) within the VM. I have tracked this down to
BaseMinaClient:

    public void disconnect() {
        if ( session!= null && session.isConnected() ) {
            session.close();
            session.getCloseFuture().join();
        }
    }

Expllicitly calling wsh.dispose(), session.isConnected() (from IoSession)
always yields true even when the workflow instance has terminated already
and there are no more active human tasks available. 

Is this an intended behaviour?

Thanks and best

Markus
(Continue reading)

Shah, Malay | 2 Dec 2009 00:44
Favicon

Drool Rule Error with "or not" condition

Hi All,
 
I have the following drool rule that has "or not" under Entity Block. Basically, the rule tries to check if there either exists an entity object EtsExecutionOrderXref_core00 with the given conditions, or the entity does not exist at all with some other conditions. 
 
dialect "mvel"
rule "Legacy ETSDB Rule"
when
EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm != "0")
EtsExecutionOrderXref_core00:
(
 EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceID != "2" && referenceIDType == "orderSubCapacity"
 )
 or not(EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceIDType == "orderSubCapacity"
 ))
)
then
end
 
But, while compiling the rule, I am getting the following errors:
 
org.drools.compiler.DroolsParserException: [ERR 101] Line 22:16 no viable alternative at input 'entityOID' in rule "Legacy ETSDB Rule" in pattern not,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:68 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:122 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:176 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID in pattern EtsExecutionOrderHist_core0.entityVID]

I think the rule is correct, but am not able to figure out these compilation errors. Could anybody please comment on why this would happen?
 
Thanks
 
Malay Shah

NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.

_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
Mark Proctor | 2 Dec 2009 00:55

Re: Drool Rule Error with "or not" condition

You are binding the result of the 'or' to EtsExecutionOrderXref_core00 as the second part is a 'not' which returns nothing, how would it be bound to?

Shah, Malay wrote:
Hi All,
 
I have the following drool rule that has "or not" under Entity Block. Basically, the rule tries to check if there either exists an entity object EtsExecutionOrderXref_core00 with the given conditions, or the entity does not exist at all with some other conditions. 
 
dialect "mvel"
rule "Legacy ETSDB Rule"
when
EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm != "0")
EtsExecutionOrderXref_core00:
(
 EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceID != "2" && referenceIDType == "orderSubCapacity"
 )
 or not(EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceIDType == "orderSubCapacity"
 ))
)
then
end
 
But, while compiling the rule, I am getting the following errors:
 
org.drools.compiler.DroolsParserException: [ERR 101] Line 22:16 no viable alternative at input 'entityOID' in rule "Legacy ETSDB Rule" in pattern not,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:68 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:122 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:176 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID in pattern EtsExecutionOrderHist_core0.entityVID]

I think the rule is correct, but am not able to figure out these compilation errors. Could anybody please comment on why this would happen?
 
Thanks
 
Malay Shah

NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.

_______________________________________________ rules-users mailing list rules-users <at> lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
Shah, Malay | 2 Dec 2009 01:28
Favicon

Re: Drool Rule Error with "or not" condition

Thanks Mark. I removed the binding and the rule is compiled now, but while firing the rule over set of objects, I get a Null pointer exception.
Here is the updated Drool rule:
 
dialect "mvel"
rule "Legacy ETSDB Rule"
when
        EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm != "0")
        EtsExecutionOrderXref_core00:EtsExecutionOrderXref_core
        (
            entityOID == EtsExecutionOrderHist_core0.entityOID,
            entityRID == EtsExecutionOrderHist_core0.entityRID,
            entityVID == EtsExecutionOrderHist_core0.entityVID,
            referenceID != "2" && referenceIDType == "orderSubCapacity"
        )
        or
        not(EtsExecutionOrderXref_core
                (
                    entityOID == EtsExecutionOrderHist_core0.entityOID,
                    entityRID == EtsExecutionOrderHist_core0.entityRID,
                    entityVID == EtsExecutionOrderHist_core0.entityVID,
                    referenceIDType == "orderSubCapacity"
                )
            )
then
    System.out.println("Rule fired");
end
 
and here is the stack trace:
 
Exception in thread "main" org.drools.runtime.rule.ConsequenceException: java.lang.NullPointerException
 at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
 at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
 at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
 at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
 at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
 at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:637)
 at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:203)
 at com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:142)
 at com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:73)
 at com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.performDQ(DQCommandLineMain.java:291)
 at com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.runEngine(DQCommandLineMain.java:196)
 at com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.main(DQCommandLineMain.java:170)
Caused by: java.lang.NullPointerException
 at org.drools.base.mvel.DroolsMVELFactory.getTupleObjectFor(DroolsMVELFactory.java:182)
 at org.drools.base.mvel.DroolsMVELFactory.setContext(DroolsMVELFactory.java:176)
 at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:57)
 at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
 ... 10 more
 
After debugging through, DroolMVELFactory class object is looking for Declaration definition for "EtsExecutionOrderXref_core00", not finding it, and hence giving a null pointer exception. I am using Drools 5.0.1. Any idea about why this would happen? Does the rule seem right now?
Thanks
 
Malay Shah

 
From: rules-users-bounces <at> lists.jboss.org [mailto:rules-users-bounces <at> lists.jboss.org] On Behalf Of Mark Proctor
Sent: Tuesday, December 01, 2009 6:56 PM
To: Rules Users List
Subject: Re: [rules-users] Drool Rule Error with "or not" condition

You are binding the result of the 'or' to EtsExecutionOrderXref_core00 as the second part is a 'not' which returns nothing, how would it be bound to?

Shah, Malay wrote:
Hi All,
 
I have the following drool rule that has "or not" under Entity Block. Basically, the rule tries to check if there either exists an entity object EtsExecutionOrderXref_core00 with the given conditions, or the entity does not exist at all with some other conditions. 
 
dialect "mvel"
rule "Legacy ETSDB Rule"
when
EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm != "0")
EtsExecutionOrderXref_core00:
(
 EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceID != "2" && referenceIDType == "orderSubCapacity"
 )
 or not(EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceIDType == "orderSubCapacity"
 ))
)
then
end
 
But, while compiling the rule, I am getting the following errors:
 
org.drools.compiler.DroolsParserException: [ERR 101] Line 22:16 no viable alternative at input 'entityOID' in rule "Legacy ETSDB Rule" in pattern not,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:68 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:122 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:176 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID in pattern EtsExecutionOrderHist_core0.entityVID]

I think the rule is correct, but am not able to figure out these compilation errors. Could anybody please comment on why this would happen?
 
Thanks
 
Malay Shah

NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.

_______________________________________________ rules-users mailing list rules-users <at> lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.

_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
rbolla | 2 Dec 2009 01:29
Picon

command line utility for importing rules


Hi, 
I'm a systems engineer and I want to import rules to guvnor. 
I dont want to do this by guvnor web UI (Administration --> import/export).
Rather, I want to use a command to upload repository_export.xml file.

something like, 
$java_home/java org.drools.repository.something repository_export.xml

Can you help me in finding the command.

Thanks,
--

-- 
View this message in context: http://n3.nabble.com/command-line-utility-for-importing-rules-tp65886p65886.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Sinboy Zhang | 2 Dec 2009 05:38
Picon

Re: How to store the rules data into RDBMS, like mysql, oracle

Thanks a lot.
After replace all of ${wsp.name} with default in repository.xml,guvnor run well.But import examples, import jar model,save new rule etc ,will catch the exceptions
 
---------------------------------------------
repository.xml:
 
<?xml version="1.0"?>

<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN"
                            "http://jackrabbit.apache.org/dtd/repository-1.4.dtd">
<!-- Example Repository Configuration File -->
<Repository>
    <!--
        virtual file system where the repository stores global state
        (e.g. registered namespaces, custom node types, etc.)
    -->
    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
        <param name="path" value="${rep.home}/repository"/>
    </FileSystem>
    <!--
        security configuration
    -->
    <Security appName="Jackrabbit">
        <!--
            access manager:
            class: FQN of class implementing the AccessManager interface
        -->
        <AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager">
            <!-- <param name="config" value="${rep.home}/access.xml"/> -->
        </AccessManager>
        <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
           <!-- anonymous user name ('anonymous' is the default value) -->
           <!-- <param name="anonymousId" value="anonymous"/> -->
           <!--
              default user name to be used instead of the anonymous user
              when no login credentials are provided (unset by default)
           -->
           <!-- <param name="defaultUserId" value="superuser"/> -->
        </LoginModule>
    </Security>
    <!--
        location of workspaces root directory and name of default workspace
    -->
    <Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default"/>
    <!--
        workspace configuration template:
        used to create the initial workspace if there's no workspace yet
    -->
    <Workspace name="default">
        <!--
            virtual file system of the workspace:
            class: FQN of class implementing the FileSystem interface
        -->
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${wsp.home}"/>
        </FileSystem>
        <!--
            persistence manager of the workspace:
            class: FQN of class implementing the PersistenceManager interface
        -->
    <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
       <param name="driver" value="com.mysql.jdbc.Driver"/>
       <param name="url" value="jdbc:mysql://localhost:3306/guvnor_db"/>
       <param name="user" value="root" />
       <param name="password" value="a123456" />
       <param name="schema" value="mysql"/>
       <param name="schemaObjectPrefix" value="default_"/>
       <param name="externalBLOBs" value="false"/>
   </PersistenceManager>
        <!--
            Search index and the file system it uses.
            class: FQN of class implementing the QueryHandler interface
        -->
        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="textFilterClasses" value="org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
            <param name="extractorPoolSize" value="2"/>
            <param name="supportHighlighting" value="true"/>
        </SearchIndex>
    </Workspace>
    <!--
        Configures the versioning
    -->
    <Versioning rootPath="${rep.home}/version">
        <!--
            Configures the filesystem to use for versioning for the respective
            persistence manager
        -->
        <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
            <param name="path" value="${rep.home}/version" />
        </FileSystem>
        <!--
            Configures the persistence manager to be used for persisting version state.
            Please note that the current versioning implementation is based on
            a 'normal' persistence manager, but this could change in future
            implementations.
        -->
    <PersistenceManager class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
       <param name="driver" value="com.mysql.jdbc.Driver"/>
       <param name="url" value="jdbc:mysql://localhost:3306/guvnor_db"/>
       <param name="user" value="root" />
       <param name="password" value="a123456" />
       <param name="schema" value="mysql"/>
       <param name="schemaObjectPrefix" value="default_"/>
       <param name="externalBLOBs" value="false"/>
   </PersistenceManager>
    </Versioning>
    <!--
        Search index for content that is shared repository wide
        (/jcr:system tree, contains mainly versions)
    -->
    <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
        <param name="path" value="${rep.home}/repository/index"/>
        <param name="textFilterClasses" value="org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>
        <param name="extractorPoolSize" value="2"/>
        <param name="supportHighlighting" value="true"/>
    </SearchIndex>
</Repository>


2009/12/1 Jervisliu <jliu <at> redhat.com>
A quick Google search indicated that this is probably a JackRabbit
issue, see [1]. Did not dig deeper to see if this issue has been fixed
in JackRabbit. You may want to find it out by yourself. One workaround
is to replace ${wsp.name <http://wsp.name>} with "default".

[1].
http://mail-archives.apache.org/mod_mbox/jackrabbit-dev/200601.mbox/%3C004701c61db2$244cb970$b6fdfe0a <at> gkaradimitr%3E

Cheers,
Jervis Liu

Sinboy Zhang wrote:
> Hi,all:
>    Guvnor is a BRMS,it can manage the rules through Jackrabbit
> Repository.The default,Guvnor work well with derby database.But i want
> it work with my database,just like MySQL.
> My step is :
>   1.Run Guvnor with default,and generate the repository.xml and
> repository dictionary at JBOSS_HOME\bin dictionary
>   2.delete repository dictionary and edit repository.xml,only replace
> the content in <PersistenceManage> label ,just like this:
>     <PersistenceManager
> class="org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager">
>        <param name="driver" value="com.mysql.jdbc.Driver"/>
>        <param name="url" value="jdbc:mysql://localhost:3306/guvnor_db"/>
>        <param name="user" value="root" />
>        <param name="password" value="a123456" />
>        <param name="schema" value="mysql"/>
>        <param name="schemaObjectPrefix" value="${wsp.name
> <http://wsp.name>}_"/>
>        <param name="externalBLOBs" value="false"/>
>    </PersistenceManager>
>   3.install Mysql database,and create the guvnor_db database
> instance,and copy mysql driver to JBOSS_HOME\server\deploy\lib
>   4.Restart the JBoss ,i get the exception:
>      org.drools.repository.RulesRepositoryException:
> javax.jcr.RepositoryException: Invalid repository configuration:
> repository.xml: Replacement not found for ${wsp.name
> <http://wsp.name>}.: Replacement not found for ${wsp.name
> <http://wsp.name>}.
>
>   Why?Please help me,thanks!
> ------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users <at> lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>

_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
Wolfgang Laun | 2 Dec 2009 07:46
Picon

Re: Drool Rule Error with "or not" condition

Binding a variable to a fact in a branch of an 'or' (as you are doing with EtsExecutionOrderXref_core00) is not useful, since you cannot use this binding in the consequence. (The rule might just as well fire due to the 2nd term (the "or not...") being true, and then the variable would not be bound, causing NPE.

If you do need this binding to access the fact in the consequence, you should splt the rule.

-W

2009/12/2 Shah, Malay <Malay.Shah <at> morganstanley.com>
Thanks Mark. I removed the binding and the rule is compiled now, but while firing the rule over set of objects, I get a Null pointer exception.
Here is the updated Drool rule:
 
dialect "mvel"
rule "Legacy ETSDB Rule"
when
        EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm != "0")
        EtsExecutionOrderXref_core00:EtsExecutionOrderXref_core
        (
            entityOID == EtsExecutionOrderHist_core0.entityOID,
            entityRID == EtsExecutionOrderHist_core0.entityRID,
            entityVID == EtsExecutionOrderHist_core0.entityVID,
            referenceID != "2" && referenceIDType == "orderSubCapacity"
        )
        or
        not(EtsExecutionOrderXref_core
                (
                    entityOID == EtsExecutionOrderHist_core0.entityOID,
                    entityRID == EtsExecutionOrderHist_core0.entityRID,
                    entityVID == EtsExecutionOrderHist_core0.entityVID,
                    referenceIDType == "orderSubCapacity"
                )
            )
then
    System.out.println("Rule fired");
end
 
and here is the stack trace:
 
Exception in thread "main" org.drools.runtime.rule.ConsequenceException: java.lang.NullPointerException
 at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
 at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
 at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
 at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
 at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
 at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:637)
 at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:203)
 at com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:142)
 at com.ms.ruleutils.RuleProcessor.process(RuleProcessor.java:73)
 at com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.performDQ(DQCommandLineMain.java:291)
 at com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.runEngine(DQCommandLineMain.java:196)
 at com.ms.ieddata.dataQuality.dqWithRR.DQCommandLineMain.main(DQCommandLineMain.java:170)
Caused by: java.lang.NullPointerException
 at org.drools.base.mvel.DroolsMVELFactory.getTupleObjectFor(DroolsMVELFactory.java:182)
 at org.drools.base.mvel.DroolsMVELFactory.setContext(DroolsMVELFactory.java:176)
 at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:57)
 at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
 ... 10 more
 
After debugging through, DroolMVELFactory class object is looking for Declaration definition for "EtsExecutionOrderXref_core00", not finding it, and hence giving a null pointer exception. I am using Drools 5.0.1. Any idea about why this would happen? Does the rule seem right now?
Thanks
 
Malay Shah

 
From: rules-users-bounces <at> lists.jboss.org [mailto:rules-users-bounces <at> lists.jboss.org] On Behalf Of Mark Proctor
Sent: Tuesday, December 01, 2009 6:56 PM
To: Rules Users List
Subject: Re: [rules-users] Drool Rule Error with "or not" condition

You are binding the result of the 'or' to EtsExecutionOrderXref_core00 as the second part is a 'not' which returns nothing, how would it be bound to?

Shah, Malay wrote:
Hi All,
 
I have the following drool rule that has "or not" under Entity Block. Basically, the rule tries to check if there either exists an entity object EtsExecutionOrderXref_core00 with the given conditions, or the entity does not exist at all with some other conditions. 
 
dialect "mvel"
rule "Legacy ETSDB Rule"
when
EtsExecutionOrderHist_core0:EtsExecutionOrderHist_core(customerOrFirm != "0")
EtsExecutionOrderXref_core00:
(
 EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceID != "2" && referenceIDType == "orderSubCapacity"
 )
 or not(EtsExecutionOrderXref_core
 (
  entityOID == EtsExecutionOrderHist_core0.entityOID , entityRID == EtsExecutionOrderHist_core0.entityRID , entityVID == EtsExecutionOrderHist_core0.entityVID , referenceIDType == "orderSubCapacity"
 ))
)
then
end
 
But, while compiling the rule, I am getting the following errors:
 
org.drools.compiler.DroolsParserException: [ERR 101] Line 22:16 no viable alternative at input 'entityOID' in rule "Legacy ETSDB Rule" in pattern not,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:68 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:122 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID,

org.drools.compiler.DroolsParserException: [ERR 102] Line 22:176 mismatched input ',' expecting '(' in rule "Legacy ETSDB Rule" in pattern EtsExecutionOrderHist_core0.entityOID in pattern EtsExecutionOrderHist_core0.entityRID in pattern EtsExecutionOrderHist_core0.entityVID]

I think the rule is correct, but am not able to figure out these compilation errors. Could anybody please comment on why this would happen?
 
Thanks
 
Malay Shah

NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.

_______________________________________________ rules-users mailing list rules-users <at> lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

NOTICE: If received in error, please destroy, and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error. We may monitor and store emails to the extent permitted by applicable law.


_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Gmane