Re: [rules-users] GWT Console - Drools Flow problems.

2010-08-09 Thread drooRam

Hi

  Did u find any solution on this? i am facing the same issue but not on the
guvnor, when i tried to use the drools:ksession tag , i have got all the
above errors mentioned in your stack trace like... "could not commit or
rollback session".."unable to rollback".. "Transaction is already
completed...session closed or no session available" 


  

  
  
  
 
 


  
 

It is all from at
org.drools.persistence.session.SingleSessionCommandService.(SingleSessionCommandService.java:130)

It really frustrates that i can't get any proper docs/direction available on
this. any soln/help wud be much appreciated. Thanks

-drooRam
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/GWT-Console-Drools-Flow-problems-tp998635p1066321.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using rule flow in Guvnor

2010-08-09 Thread priasa

have you found the solution?
because i have a similiar problem.


thanks.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Using-rule-flow-in-Guvnor-tp1057004p1066016.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] functions inside fact type declaration?

2010-08-09 Thread Edson Tirelli
Hehe, ok, you convinced me Greg! ;)

https://jira.jboss.org/browse/JBRULES-2652

Edson

2010/8/9 Greg Barton 

> +1 on the full constructor.
>
> GreG
>
> On Aug 9, 2010, at 3:58 PM, Edson Tirelli  wrote:
>
> I thought about adding that, but I feel like we would just be
> reimplementing java, in this case. So, if you need anything else other than
> simple java beans, you should implement it as a java class.
>
> Regarding the constructor, I might still add a constructor that
> receives all fields as parameters, just to reduce verbosity when using the
> java dialect, but if you are using mvel dialect, you can use "with":
>
> rule ...
> when ...
> then
> with( person = new Person() ) {
>  name = "Bob",
>  age = 35
> }
> insert( person );
> end
>
> Edson
>
> 2010/8/9 Tina Vießmann < 
> tviessm...@stud.hs-bremen.de>
>
>> Hi,
>>
>> is it possible to define a function/constructor inside a fact type
>> declaration? If yes, how can it be done?
>>
>> Thank you :)
>> Tina
>> ___
>> rules-users mailing list
>>  rules-users@lists.jboss.org
>>  
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] drools in a SOA environment

2010-08-09 Thread Dieter D'haeyere
I have some questions regarding the overall view of what is happening where
when using Drools in a service oriented environment.

This is the idea:
Some applications are making use of rules for some calculations.  The idea
is to be able to call the rule engine as a service.  Meaning: passing all
facts to the rule base and based on that, rules will be fired and the facts
will be updated.  Rules will be called a lot so scalability is important.
Next to that: the conclusion part should be able to call other services, eg.
to do some calculations.  An ESB is available so communication could go over
that bus.

Now: this is how I see it:

Drools Guvnor is the place where the rules are stored and managed. (war)
Drools Server is where the actual calculations take place. (war but... when
more load must be handled, multiple instance could be deployed).
The application does a SOAP call to Drools Server (passes facts and
commandos) and all is ok...

Well .. now the problem starts... I don't get it :)
I mean: how does Drools Server talk to the rule base ?  I haven't found a
clear article (but probably it does exist, just didn't find it yet) where
this cooperation is demonstrated.

Also: I read about Camel / Spring / Rest which would be the new way to call
a service... So SOAP is no longer supported (or will be deprecated as of
Drools v5.x ?)

An overview and / or some best practices on how to design the architecture
would be welcome.

Btw, as I understand it now, Drools - grid will be the way to go.  But that
will probably will be for version > 5.2.
And then again, I am confused about the split between the rule 'engine' (I
have been told that there is not such a thing as a big calculating engine)
and the rule repository.
I kind of would expect that those two could be coupled tightly together (ok,
there is probably a good reason why choices are made as they are, I am way
too newbie to interfere in any such discussion).

Sincerely,
Dieter D'haeyere.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] functions inside fact type declaration?

2010-08-09 Thread Greg Barton
+1 on the full constructor.

GreG

On Aug 9, 2010, at 3:58 PM, Edson Tirelli  wrote:

I thought about adding that, but I feel like we would just be 
reimplementing java, in this case. So, if you need anything else other than 
simple java beans, you should implement it as a java class.

Regarding the constructor, I might still add a constructor that receives 
all fields as parameters, just to reduce verbosity when using the java dialect, 
but if you are using mvel dialect, you can use "with":

rule ...
when ...
then
with( person = new Person() ) {
 name = "Bob",
 age = 35
}
insert( person );
end
  
Edson

2010/8/9 Tina Vießmann 
Hi,

is it possible to define a function/constructor inside a fact type
declaration? If yes, how can it be done?

Thank you :)
Tina
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



  ___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] functions inside fact type declaration?

2010-08-09 Thread Edson Tirelli
I thought about adding that, but I feel like we would just be
reimplementing java, in this case. So, if you need anything else other than
simple java beans, you should implement it as a java class.

Regarding the constructor, I might still add a constructor that receives
all fields as parameters, just to reduce verbosity when using the java
dialect, but if you are using mvel dialect, you can use "with":

rule ...
when ...
then
with( person = new Person() ) {
 name = "Bob",
 age = 35
}
insert( person );
end

Edson

2010/8/9 Tina Vießmann 

> Hi,
>
> is it possible to define a function/constructor inside a fact type
> declaration? If yes, how can it be done?
>
> Thank you :)
> Tina
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] functions inside fact type declaration?

2010-08-09 Thread Tina Vießmann
Hi,

is it possible to define a function/constructor inside a fact type 
declaration? If yes, how can it be done?

Thank you :)
Tina
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Meaning of the metadata 'key'

2010-08-09 Thread Edson Tirelli
   Tina,

   No problem. That is one of the items I think it is missing in the docs.
It just means that field will be considered on the generated equals() and
hashcode() methods of the bean. Example:

declare Person
firstName : String @key
lastName : String @key
address : Address
end

   The above example will generate a Person bean class and will consider
first and last name as identifiers for the person. So, two instance with the
same first and last name will generate the same hashcode and the equals
method will return true when comparing them, even if the address is
different.

   Edson

2010/8/9 Tina Vießmann 

> Hi,
>
> I think I'm to stupid to google, but I can't find an explanation what
> '@key' means.
> Can anyone please explain it to me or just give me a link?
>
> Sorry for the simple and stupid request and thank you for your help!
>
> Greetings
> Tina
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Meaning of the metadata 'key'

2010-08-09 Thread Tina Vießmann
Hi,

I think I'm to stupid to google, but I can't find an explanation what 
'@key' means.
Can anyone please explain it to me or just give me a link?

Sorry for the simple and stupid request and thank you for your help!

Greetings
Tina
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Help needed in Rule flow in Guvnor

2010-08-09 Thread Vignesh

Hi,

I am using Rule flow in Guvnor for setting some value out of the flow which
would be used for my further processing. Below is what I'm trying to
achieve,

I have two rule groups in the rule flow, out of which the first one would
set a  pair in a Map which is a field in one of the bean class
declared Global for the package when ever each rule is executed in the set
of rules in the group and the next rule group would be required to have a
set of rules that needs to be executed against this Map which was set in the
first rules group and send the final result as output out of the flow.

I have defined the rules in the first rule group and set the Map with
necessary keys and values, but I was not able to read the Map in this second
rule group. I had tried this second rule group as a custom java code in my
Java part after the rules execution from guvnor and able to read the map
that was set from the first rule group and able set the final decision.

I want to know whether reading the Map from the second rule group which was
set in the first rule group is possible or not. Or kindly let me know
whether I'm missing anything here and needed to add any other logic to
achieve the same.

Thanks,
Vignesh
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Help-needed-in-Rule-flow-in-Guvnor-tp1059410p1059410.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Getting NullPointer Exception while sending an response back from Guvnor using web services

2010-08-09 Thread Vignesh

Hi Jervis,

I have tried to invoke the Rules that has been defined in the Guvnor rule
engine, which was done standalone earlier and worked fine with out any
issues. But I'm getting the below exception when I added the Guvnor project
as a JAR to this web service and while trying to invoke the rules from the
skeleton I was able to hit the rule engine and got the actual results out of
it with out any issues and got the below exception while returning the
response back to the client from the skeleton.

Kindly let me know if you need more details.

Thanks,
Vignesh 
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Getting-NullPointer-Exception-while-sending-an-response-back-from-Guvnor-using-web-services-tp1025999p1059172.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Getting NullPointer Exception while sending an response back from Guvnor using web services

2010-08-09 Thread Jervis Liu
The stack trace does not tell much, the cause could be anything. Could 
you be more specific on what you have done please: " tried invoking the 
same from a webservice by including this guvnor project as a JAR". You 
exposed what as web services? and how?

Cheers,
Jervis

On 2010/8/5 20:40, Vignesh wrote:
>
> Hi,
>
> I have defined a set of rules using DSL and corresponding rules in Guvnor
> and i have tested the same using a standalone code which is working fine.
> But when i tried invoking the same from a webservice by including this
> guvnor project as a JAR Im getting a NullPointerException while sending the
> response back from Guvnor to the web service client,
>
> below is the exception stack i got in server side,
>
> ERROR - AxisServlet.doPost(172) |
> java.lang.NullPointerException
>  at
> org.apache.axis2.clustering.context.DefaultContextManager.updateContexts(DefaultContextManager.java:81)
>  at
> org.apache.axis2.clustering.context.Replicator.replicate(Replicator.java:81)
>  at
> org.apache.axis2.receivers.AbstractMessageReceiver.replicateState(AbstractMessageReceiver.java:71)
>  at
> org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:41)
>  at
> org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
>  at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
>  at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
>  at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>  at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>  at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>  at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>  at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
>  at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process
> Http11Protocol.java:588)
>  at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
>  at java.lang.Thread.run(Thread.java:595)
>
> and the below is the exception stack in client side,
>
> org.apache.axis2.AxisFault: java.lang.NullPointerException
>   at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
>   at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
>   at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>   at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>   at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>   at org.tempuri.Service1Stub.CheckEntitlement(Service1Stub.java:740)
>   at ws.client.testClient.main(testClient.java:73)
>
> If any one has faced similar issue and fixed the same, please help me out it
> resolving the same or any pointers for fixing this issue would be of great
> helpful.
>
> Thanks,
> Vignesh

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Missing Drools Pipeline

2010-08-09 Thread Mark Proctor
  On 09/08/2010 16:20, Thorsten wrote:
> Hello out there,
>
> I just installed the Drools 5.1 final and have read the updated
> documentation of Expert and Fusion. I wonder what happend to the
> Pipeline-classes? It seems like they are no longer inside the packages.
> Do you have more information?
pipeline was an experimentation for how to use drools within a service 
architecture. We've now deprecated that in favour of using spring and 
camel. However drools-pipeline.jar is still there for those that were 
using it. But I'd strongly recommend you invest your time in camel, it's 
far superior.

Mark
>
> Thanks and regards
> Thorsten
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using rule flow in Guvnor

2010-08-09 Thread Dinesh kumar

Sorry, my .rfm file was not pasted properly in the previous post


I checked the rule flow model in eclipse using the green tick mark and it
showed Drools flow model checked successfully. My .rf and .rfm files were
created. But when I imported .rf file in my guvnor and build the package I
am getting the following error : Unable to parse xml When i checked the
server log, only this was printed : (null: 1, 93): cvc-elt.1: Cannot find
the declaration of element
'org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper'. 


  

  1
  
1
Start


  
1


  ailmentreserves
  2
  AilmentReserves
  

  
  

  1
  
  
benefitreserves
3
BenefitReserves

  


  
1


  4
  End
  

  
  

  

  

  

  

  


  2
  


  3
  


  4
  

  
  
  4
  resistrationflow
  RuleFlowTest
  1.0
  RuleFlow
  HealthCareTest


Am I missing anything. Should the package name in the eclipse same as the
package I use in guvnor ? I have only the rule flow file in Eclipse and
remaining are written directly in guvnor. Any hint on this will be of great
help. Regards, Dinesh 


-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Using-rule-flow-in-Guvnor-tp1057004p1057128.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Using rule flow in Guvnor

2010-08-09 Thread Dinesh kumar

Hi,

I am having an issue in implementing the rule flow in guvnor.

I created a simple rule flow using eclipse plug in. 

http://drools-java-rules-engine.46999.n3.nabble.com/file/n1057004/rules.jpg 

I checked the rule flow model in eclipse using the green tick mark and it
showed Drools flow model checked successfully. My .rf and .rfm files were
created.

But when I imported .rf file in my guvnor and build the package I am getting
the following error : Unable to parse xml

When i checked the server log, only this was printed : 
(null: 1, 93): cvc-elt.1: Cannot find the declaration of element
'org.drools.eclipse.flow.ruleflow.core.RuleFlowProcessWrapper'.




This is the source of the generated .rfm file


  

  1
  
1
Start


  
1


  ailmentreserves
  2
  AilmentReserves
  

  
  

  1
  
  
benefitreserves
3
BenefitReserves

  


  
1


  4
  End
  

  
  

  

  

  

  

  


  2
  


  3
  


  4
  

  
  
  4
  resistrationflow
  RuleFlowTest
  1.0
  RuleFlow
  HealthCareTest



Am I missing anything. Should the package name in the eclipse same as the
package I use in guvnor ?
I have only the rule flow file in Eclipse and remaining are written directly
in guvnor. 

Any hint on this will be of great help.


Regards,
Dinesh
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Using-rule-flow-in-Guvnor-tp1057004p1057004.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Missing Drools Pipeline

2010-08-09 Thread Thorsten
Hello out there,

I just installed the Drools 5.1 final and have read the updated 
documentation of Expert and Fusion. I wonder what happend to the 
Pipeline-classes? It seems like they are no longer inside the packages.
Do you have more information?


Thanks and regards
Thorsten

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] CPU Spike creating a StatefulKnowledgeSession using OSGi

2010-08-09 Thread David Conde
Is it possible that this might be invoking the compiler when a session is
created? I have all of the init code in the service start call and stored as
members of the service for reuse but I must create a new knowledge session
for each run.

Any ideas?

Thanks,
Dave

-- Forwarded message --
From: David Conde 
Date: 9 August 2010 11:17
Subject: Re: [rules-users] CPU Spike creating a StatefulKnowledgeSession
using OSGi
To: Rules Users List 


The line that it spikes on is StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();.

Cheers,
Dave


On 9 August 2010 11:09, Pavel Tavoda  wrote:

> Is it session creation or rule compilation?
>
> Pavel
>
> 2010/8/9 David Conde :
> > Good Morning,
> > I now have drools running on the Spring DM-Server but I am seeing a CPU
> > spike when creating a StatefulKnowledgeSession. I've tested this outside
> of
> > an OSGi environment and I don't see the spike. Does anyone know any
> settings
> > that I can change that might make this go away?
> > Thanks,
> > Dave
> >
> > --
> > David Conde
> > CTO Calom Technologies
> >
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] UTF8 characters corrupted when embedded in DRL files

2010-08-09 Thread Jervis Liu
Could you please try Drools 5.1? This should have been fixed.

Cheers,
Jervis

On 2010/8/9 19:13, crafferty wrote:
>
> Drools, version, 5.0.1 running on Java 1.6.0_12
>
> Our application creates rules in DRL files,  the rules contain non-Latin
> characters,  here is an example rule:
>
> //
> //
> // TRIGGER_ RULE: Detect Dual Receiver Failure
> //
> //
>
> rule TRIGGER_Detect_Dual_Receiver_Failure_43296731577724
>   no-loop true
>   salience 0
>
>   when
>
> // When a Child Group exists with:
>
>   child0:ChildGroup(
> //base class is "com.sidonis.vp.dtvexample.BroadcastEquipment"
>
>   baseClass == 
> "com.sidonis.vp.dtvexample.BroadcastEquipment",
>
>
> //parent base class is "com.sidonis.vp.dtvexample.BroadcastEquipment"
>
>   parentBaseClass == 
> "com.sidonis.vp.dtvexample.BroadcastEquipment",
>
>
> //parent sub class starts with "DualReceiver"
>
>   child0_parentSubClass:parentSubClass ->
> (child0_parentSubClass.startsWith( "DualReceiver" )),
>
>
> //failed count is 2
>
>   failed == 2
>   )
>   then
>StatisticsSystemRuleFunctions.incrementTrigRuleCount();
>   StatePropagationFunctions.trigForceParentFailedViaChild(
> "TRIGGER_Detect_Dual_Receiver_Failure_43296731577724",
>"あえいおう",
>child0,
>true );
>   end
>   
> When the static method trigForceParentFailedViaChild is invoke as a
> consequence of fullfilling the rule conditions,  the non-latin text in the
> second argument is corrupted when output to a file.
>
> The DRL is loaded as a resource by our application and passed to Drools
> thus:
>
>   try {
>   final FileInputStream fis = new 
> FileInputStream(drlFile);
>   fr = new InputStreamReader(fis, textEncoding);
>   
>   } catch (FileNotFoundException e1) {
>   log.error("Cannot open DRL file: " + 
> drlFile.getName());
>   return null;
>   } catch (UnsupportedEncodingException e) {
>   log.error("Text encoding configuration problem 
> " + textEncoding);
>   return null;
>   }
>   // Load DRL file into PackageBuilder and create Package
>   Resource resource = ResourceFactory.newReaderResource(fr, 
> textEncoding);
>   
>   KnowledgeBuilder knowledgeBuilder =
> KnowledgeBuilderFactory.newKnowledgeBuilder(knowledgeBuilderConfiguration);
>
>   knowledgeBuilder.add(resource, ResourceType.DRL);
>
> Note, 'textEncoding' is loaded from a properties file by the application and
> is set to "UTF8".   The system property "file.encoding" for the
> application's JVM is also set to "UTF8".
>
> We have also tried using the ResourceFactory's newFileResource passing it
> the drlFile Object, but to no avail, the result is the same.
>
> So we have debugged the Drools 5.0.1 source and discovered that when the
> stream representing the DRL is wrapped by the ANTLRInputStream, line 320,
> org.drools.compiler.DrlParser (drools-compiler project) the encoding of the
> input stream is not passed on to the ANTLRInputStream that is used to wrap
> it. If we modify the Drools code to use the overloaded ANTLRInputStream
> constructor that accepts the stream encoding then the non-Latin text is
> passed correctly to our method.We've also checked the code on the head
> of the repository and it is same.  Although this seems like a bug, I want to
> make sure we're not doing something wrong first.
>

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to work with org.drools.repository

2010-08-09 Thread wilsonywx

Because I only needed a small subset of the Drools functionality (i.e. just
plain rules without salience) I just made up a simple xml schema to store
the rule. I've posted some other related questions about the .brl format
(which is the xml format Guvnor uses to store rules) but haven't gotten many
useful replies. I think if you project is not overly complex it's probably
better off just making up your own storage scheme than trying to reverse
engineer the classes in Drools (fyi they use XStream to serialize and
deserialize their classes into xml). Hope that helps. 
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-work-with-org-drools-repository-tp984680p1055367.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] UTF8 characters corrupted when embedded in DRL files

2010-08-09 Thread crafferty

Drools, version, 5.0.1 running on Java 1.6.0_12

Our application creates rules in DRL files,  the rules contain non-Latin
characters,  here is an example rule:

//
//
// TRIGGER_ RULE: Detect Dual Receiver Failure
//
//

rule TRIGGER_Detect_Dual_Receiver_Failure_43296731577724
no-loop true
salience 0

when

// When a Child Group exists with:

child0:ChildGroup(
//  base class is "com.sidonis.vp.dtvexample.BroadcastEquipment"

baseClass == 
"com.sidonis.vp.dtvexample.BroadcastEquipment",


//  parent base class is "com.sidonis.vp.dtvexample.BroadcastEquipment"

parentBaseClass == 
"com.sidonis.vp.dtvexample.BroadcastEquipment",


//  parent sub class starts with "DualReceiver"

child0_parentSubClass:parentSubClass ->
(child0_parentSubClass.startsWith( "DualReceiver" )),


//  failed count is 2

failed == 2
)
then
 StatisticsSystemRuleFunctions.incrementTrigRuleCount();
StatePropagationFunctions.trigForceParentFailedViaChild(
"TRIGGER_Detect_Dual_Receiver_Failure_43296731577724",
 "あえいおう",
 child0,
 true );
end

When the static method trigForceParentFailedViaChild is invoke as a
consequence of fullfilling the rule conditions,  the non-latin text in the
second argument is corrupted when output to a file.

The DRL is loaded as a resource by our application and passed to Drools
thus:

try {
final FileInputStream fis = new 
FileInputStream(drlFile);
fr = new InputStreamReader(fis, textEncoding);

} catch (FileNotFoundException e1) {
log.error("Cannot open DRL file: " + 
drlFile.getName());
return null;
} catch (UnsupportedEncodingException e) {
log.error("Text encoding configuration problem 
" + textEncoding);
return null;
}
// Load DRL file into PackageBuilder and create Package
Resource resource = ResourceFactory.newReaderResource(fr, 
textEncoding);

KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder(knowledgeBuilderConfiguration);

knowledgeBuilder.add(resource, ResourceType.DRL);

Note, 'textEncoding' is loaded from a properties file by the application and
is set to "UTF8".   The system property "file.encoding" for the
application's JVM is also set to "UTF8".

We have also tried using the ResourceFactory's newFileResource passing it
the drlFile Object, but to no avail, the result is the same.

So we have debugged the Drools 5.0.1 source and discovered that when the
stream representing the DRL is wrapped by the ANTLRInputStream, line 320, 
org.drools.compiler.DrlParser (drools-compiler project) the encoding of the
input stream is not passed on to the ANTLRInputStream that is used to wrap
it. If we modify the Drools code to use the overloaded ANTLRInputStream
constructor that accepts the stream encoding then the non-Latin text is
passed correctly to our method.We've also checked the code on the head
of the repository and it is same.  Although this seems like a bug, I want to
make sure we're not doing something wrong first.   

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/UTF8-characters-corrupted-when-embedded-in-DRL-files-tp1054399p1054399.html
Sent from the Drools - User mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] CPU Spike creating a StatefulKnowledgeSession using OSGi

2010-08-09 Thread David Conde
The line that it spikes on is StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();.

Cheers,
Dave

On 9 August 2010 11:09, Pavel Tavoda  wrote:

> Is it session creation or rule compilation?
>
> Pavel
>
> 2010/8/9 David Conde :
> > Good Morning,
> > I now have drools running on the Spring DM-Server but I am seeing a CPU
> > spike when creating a StatefulKnowledgeSession. I've tested this outside
> of
> > an OSGi environment and I don't see the spike. Does anyone know any
> settings
> > that I can change that might make this go away?
> > Thanks,
> > Dave
> >
> > --
> > David Conde
> > CTO Calom Technologies
> >
> >
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] CPU Spike creating a StatefulKnowledgeSession using OSGi

2010-08-09 Thread Pavel Tavoda
Is it session creation or rule compilation?

Pavel

2010/8/9 David Conde :
> Good Morning,
> I now have drools running on the Spring DM-Server but I am seeing a CPU
> spike when creating a StatefulKnowledgeSession. I've tested this outside of
> an OSGi environment and I don't see the spike. Does anyone know any settings
> that I can change that might make this go away?
> Thanks,
> Dave
>
> --
> David Conde
> CTO Calom Technologies
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] CPU Spike creating a StatefulKnowledgeSession using OSGi

2010-08-09 Thread David Conde
Good Morning,

I now have drools running on the Spring DM-Server but I am seeing a CPU
spike when creating a StatefulKnowledgeSession. I've tested this outside of
an OSGi environment and I don't see the spike. Does anyone know any settings
that I can change that might make this go away?

Thanks,
Dave

-- 
David Conde
CTO Calom Technologies
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Inserting new rule in existing package

2010-08-09 Thread Pierre de Leusse
Hello all,

In my program, I receive series of rules as String in XML along with the
name of package they should be added to.

putRules(String knowledgeSet, List XMLRules)

At the moment, I load from the repository the original state of the
PackageDescr, get all rule names currently in working memory from the
StatefulKnowledgeSession and take out of the PackageDescr what's not in
working memory.

>From there, I try to manually (using DOM4J) insert the new rules in the XML
representation of the PackageDescr and load this one. But...

1) I get the following error when I try to load the latter XML (package node
is in the XML, I've checked):

Code:
XmlPackageReader xmlReader = new XmlPackageReader(null);
StringReader sr = new StringReader(documentGlob.asXML());
PackageDescr packageDescr = xmlReader.read(sr);

Error:
(null: 2, 222): 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
.
(null: 2, 222): cvc-elt.1: Cannot find the declaration of element 'package'.

2) There is a removeRule function on the KnowledgeBase class, why not
addRule, did I miss something?

3) There must be an easier way to do this. Could somebody give me some
pointers?

All the best,
Pierre

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users