[rules-users] Error in resteasy war deployment.....

2011-12-05 Thread subhransu sekhar

Hi,
   first i have integrated my resteasy ws to jbpm workflow project and added 
all the necessay jars to it.it is succesfully excuted in command prompt and 
created the wars  in repository.

but whenever i am trying to deploy that war file in tomcat(6) it shows the 
following errors:



java.lang.NoClassDefFoundError: org/drools/rule/CompositeClassLoader
at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuil

der(KnowledgeBuilderProviderImpl.java:29)
at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowle
dgeBuilderFactory.java:29)
at com.ocqc.flow.OCQCWorkflowManager.readKnowledgeBase(OCQCWorkflowManag

er.java:59)
at com.ocqc.flow.OCQCWorkflowManager.operate(OCQCWorkflowManager.java:40
)
at com.ocqc.flow.OCQCWorkflowManager.initProcess(OCQCWorkflowManager.jav
a:31)
at com.restfully.shop.services.JobResource.getAvailableReport(JobResourc

e.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.
java:140)
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.

java:255)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220
)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209
)
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(Synchronous

Dispatcher.java:519)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispa
tcher.java:496)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispa
tcher.java:119)

at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.
service(ServletContainerDispatcher.java:208)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.servi
ce(HttpServletDispatcher.java:55)

at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.servi
ce(HttpServletDispatcher.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl

icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV

alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j

ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java

:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48
9)
at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.ClassNotFoundException: org.drools.rule.CompositeClassLoade
r
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa
der.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa

der.java:1493)
... 33 more


plaese help .


Thanks & Regards

subhransu sekhar


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


[rules-users] Calling drools into the Web Application.

2011-12-05 Thread srinivasasanda
this piece of application is working using drools project, but its not
working in (webapplication)

i had a text box age and income that values i am trying passing this data to
rule and run the rules.
i created one jsp , jsp call servlet, In servelt i called the below piece of
code in servlet but not executing

I am trying to include it this piece of code into webapplication (in servlet
or jsp) it is showing error.

public static final void runMain() {
try {
RuleAgent agent = RuleAgent.newRuleAgent("/guvnor.properties");
RuleBase ruleBase = agent.getRuleBase();
WorkingMemory workingMemory = ruleBase.newStatefulSession();
FactType ft= ruleBase.getFactType("sample.person");  //created
declarative model in guvnor
Object obj=ft.newInstance();
ft.set(obj,"age", 67);
//setting data into into person
ft.set(obj, "income", 1000);
workingMemory.insert(obj);  
workingMemory.fireAllRules();
System.out.print(ft.get(obj, "age"));
System.out.print(ft.get(obj, "income"));
  } catch (Throwable t) {
t.printStackTrace();
}
}


12:46:44,409 ERROR [STDERR] RuleAgent(default) INFO (Mon Dec 05 12:46:44 GMT
2011): Configuring with
 newInstance=false, secondsToRefresh=-1
12:46:44,419 ERROR [STDERR] RuleAgent(default) INFO (Mon Dec 05 12:46:44 GMT
2011): Configuring pack
age provider : URLScanner monitoring URLs: 
http://localhost:8082/guvnor-5.2.0.Final-jboss-as-5.1/or
g.drools.guvnor.Guvnor/package/sample/LATEST
12:46:44,669 INFO  [STDOUT] INFO  05-12 12:46:44,669
(NilAuthenticator.java:authenticate:35) All
 users are guests.


12:46:44,359 ERROR [STDERR] java.lang.IllegalArgumentException: Could not
parse knowledge.
12:46:44,359 ERROR [STDERR] at
com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:115)
12:46:44,359 ERROR [STDERR] at
com.sample.DroolsTest.FireRools(DroolsTest.java:62)
12:46:44,359 ERROR [STDERR] at p1.Login.doGet(Login.java:37)
12:46:44,359 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
12:46:44,359 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


12:46:44,699 ERROR [STDERR] RuleAgent(default) EXCEPTION (Mon Dec 05
12:46:44 GMT 2011): org.drools.
rule.Package; local class incompatible: stream classdesc serialVersionUID =
510, local class serialV
ersionUID = 400. Stack trace should follow.
12:46:44,699 ERROR [STDERR] java.io.InvalidClassException:
org.drools.rule.Package; local class inco
mpatible: stream classdesc serialVersionUID = 510, local class
serialVersionUID = 400
12:46:44,699 ERROR [STDERR] at
java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562
)

--
View this message in context: 
http://drools.46999.n3.nabble.com/Calling-drools-into-the-Web-Application-tp3561362p3561362.html
Sent from the Drools: User forum 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] Drools Ruleflow persistence on MySQL - invalid SQL query generated

2011-12-05 Thread victorC
Hi folks,

still desperately struggling with no success - an invalid SQL query is
issued during Drools Flow JPA persistence and I cannot find the reason for
this.

select processins0_.InstanceId as col_0_0_ from ProcessInstanceInfo
processins0_, EventTypes eventtypes1_ where
processins0_.InstanceId=eventtypes1_.InstanceId and (? in (.))

I think the problem is in the last part: "and (? in (.))" but cannot figure
what caused it.

Any ideas?

Thank you in advance,




--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Ruleflow-persistence-on-MySQL-invalid-SQL-query-generated-tp3548289p3561463.html
Sent from the Drools: User forum 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] Calling drools into the Web Application.

2011-12-05 Thread Jackson Cunha
So, let's talk about some points:

   - You should not create a new knowledge base every time you need a
   session, because construction of knowledge bases is very expensive. You
   would do this at start of application applying Singleton pattern.
   - If you already have a knowledge base, you are able to get parameters
   from GET or POST using your preferred controller, instantiate your objects
   using then and after that pass your objects for a new knowledge session
   (stateless or statefull).


On 5 December 2011 10:13, srinivasasanda  wrote:

> this piece of application is working using drools project, but its not
> working in (webapplication)
>
> i had a text box age and income that values i am trying passing this data
> to
> rule and run the rules.
> i created one jsp , jsp call servlet, In servelt i called the below piece
> of
> code in servlet but not executing
>
> I am trying to include it this piece of code into webapplication (in
> servlet
> or jsp) it is showing error.
>
> public static final void runMain() {
>try {
>RuleAgent agent =
> RuleAgent.newRuleAgent("/guvnor.properties");
>RuleBase ruleBase = agent.getRuleBase();
>WorkingMemory workingMemory = ruleBase.newStatefulSession();
>FactType ft= ruleBase.getFactType("sample.person");  //created
> declarative model in guvnor
>Object obj=ft.newInstance();
>ft.set(obj,"age", 67);
> //setting data into into person
>ft.set(obj, "income", 1000);
>workingMemory.insert(obj);
>workingMemory.fireAllRules();
>System.out.print(ft.get(obj, "age"));
>System.out.print(ft.get(obj, "income"));
>  } catch (Throwable t) {
>t.printStackTrace();
>}
>}
>
>
> 12:46:44,409 ERROR [STDERR] RuleAgent(default) INFO (Mon Dec 05 12:46:44
> GMT
> 2011): Configuring with
>  newInstance=false, secondsToRefresh=-1
> 12:46:44,419 ERROR [STDERR] RuleAgent(default) INFO (Mon Dec 05 12:46:44
> GMT
> 2011): Configuring pack
> age provider : URLScanner monitoring URLs:
> http://localhost:8082/guvnor-5.2.0.Final-jboss-as-5.1/or
> g.drools.guvnor.Guvnor/package/sample/LATEST
> 12:46:44,669 INFO  [STDOUT] INFO  05-12 12:46:44,669
> (NilAuthenticator.java:authenticate:35) All
>  users are guests.
>
>
> 12:46:44,359 ERROR [STDERR] java.lang.IllegalArgumentException: Could not
> parse knowledge.
> 12:46:44,359 ERROR [STDERR] at
> com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:115)
> 12:46:44,359 ERROR [STDERR] at
> com.sample.DroolsTest.FireRools(DroolsTest.java:62)
> 12:46:44,359 ERROR [STDERR] at p1.Login.doGet(Login.java:37)
> 12:46:44,359 ERROR [STDERR] at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> 12:46:44,359 ERROR [STDERR] at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
>
> 12:46:44,699 ERROR [STDERR] RuleAgent(default) EXCEPTION (Mon Dec 05
> 12:46:44 GMT 2011): org.drools.
> rule.Package; local class incompatible: stream classdesc serialVersionUID =
> 510, local class serialV
> ersionUID = 400. Stack trace should follow.
> 12:46:44,699 ERROR [STDERR] java.io.InvalidClassException:
> org.drools.rule.Package; local class inco
> mpatible: stream classdesc serialVersionUID = 510, local class
> serialVersionUID = 400
> 12:46:44,699 ERROR [STDERR] at
> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562
> )
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Calling-drools-into-the-Web-Application-tp3561362p3561362.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 

Jackson Cunha Cassimiro (CereB)
Bacharel em Ciencia da Computação - UFPI
MSN: jackson.ce...@gmail.com
Telefone Móvel +55 86 9928 1251
Analista de Sistemas - Infoway - http://www.infoway-pi.com.br
Missão Infoway - "Influenciar a Gestão de Sistemas de Saúde através de
e-health"

("A vida é um combate que os fracos abate, aos bravos, aos fortes só pode
exaltar" - Canção do Tamoio, Gonçalves Dias)

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


[rules-users] Drools integration common practice

2011-12-05 Thread mike
Hi there,

My company (a large HRMS vendor) wants to leverage the business engines
implementations to Drools. I am in charge of doing the piping job. So far
I've been loading objects into session and running drl files using the java
API directly. That works nice, but it keeps me in java land which makes any
programming effort 10 times harder than what I would like. At the same
time, I've been following this list and I see a lot of questions about the
Guvnor REST API. So as far as I know I have 3 choices to integrate with
Drools,

1. Java API
2. REST calls to Drools web server
3. REST calls to Guvnor

I wonder if there are some rules of thumbs on when to use which. I also
wonder what's the most common used method in average. At this point I am
leaning towards #2 because I don't need Guvnor yet. But in general I think
the REST API is a more flexible choice.

Any suggestion or a simple "I use X" will be very appreciated.
Thank you very much
Mike
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor Versioning - eclipse plug-in

2011-12-05 Thread Ronald Albury
I found a way to get Guvnor to make Version 3 the active version.  I
shut-down and restart Tomcat.

Surely this can't be the 'standard' way ... and it makes me think that I've
tripped over a bug hiding in there somewhere.

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


Re: [rules-users] Guvnor Versioning - eclipse plug-in

2011-12-05 Thread Michael Anstis
Oh bugs sure, I think it should work as you expect too.

Can you raise a JIRAs for each of your individual problems at
https://issues.jboss.org/browse/GUVNOR and we'll get round to them as soon
as we can

Unfortunately we cannot really advise *when* we may get to fix them... but
community contributions are always welcome :)

With kind regards,

Mike

2011/12/5 Ronald Albury 

> I found a way to get Guvnor to make Version 3 the active version.  I
> shut-down and restart Tomcat.
>
> Surely this can't be the 'standard' way ... and it makes me think that
> I've tripped over a bug hiding in there somewhere.
>
> Thoughts?
>
> ___
> 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] Web client-side rule testing - best practices

2011-12-05 Thread Ronald Albury
I have always thought of Drools-like systems being server-side engines -
and we have many server-side-only uses for rules.  However, for a good user
experience you should do checking as close to data entry as possible, and
there is a subset of our server rules that are redundant with the rules
governing client data entry (currently embedded in the Web interface as
Javascript).

Has anyone established a good pattern for using Drools for client-side
testing?  I'm guessing that we would need some sort of per-field Ajax
communication back to the server ... but this means per-field communication
(not good for our agents on dial-up or with slow links), and it also means
structuring our rules such that we can easily access only the appropriate
rules.

Would I, for instance, need a separate Fact object type for each field?
This seems like it would really complicate the rules - we have about a
dozen basic data structures for our server-side Facts, and each data
structure will have multiple attributes.  I don't look forward to dealing
with a couple hundred Fact types.

Would I need some sort of flag on our data structures to include in the
Fact which restricts the testing to only the field that was just entered?
This would seem to complicate the understanding of our rules.  Some rules
(even UI rules) depend on a combination of facts - so would it be a 'set'
of flags?  This seems to be moving close to the first idea (separate Fact
object types ... which seems more efficient).

So ... as you can see, I am thrashing about a bit trying to find the
correct pattern.  Can someone save me a bunch of time and bad code by
sharing their best practice with me?

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


Re: [rules-users] Calling drools into the Web Application.

2011-12-05 Thread Esteban Aliverti
Which version of drools are you using? RuleBase, RuleAgent and
WorkingMemory are not used anymore. And, this piece of log makes me think
if the version of Guvnor you are running is different to the version of
Drools you are using in your webapp:

org.drools.
rule.Package; local class incompatible: stream classdesc serialVersionUID =
510, local class serialV
ersionUID = 400

Seems you are using Guvnor 5.1 but Drools 4.0 in your webapp. If you are
just starting with drools, I'd suggest you to use the latest stable version
5.3.

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2011/12/5 Jackson Cunha 

> So, let's talk about some points:
>
>- You should not create a new knowledge base every time you need a
>session, because construction of knowledge bases is very expensive. You
>would do this at start of application applying Singleton pattern.
>- If you already have a knowledge base, you are able to get parameters
>from GET or POST using your preferred controller, instantiate your objects
>using then and after that pass your objects for a new knowledge session
>(stateless or statefull).
>
>
> On 5 December 2011 10:13, srinivasasanda  wrote:
>
>> this piece of application is working using drools project, but its not
>> working in (webapplication)
>>
>> i had a text box age and income that values i am trying passing this data
>> to
>> rule and run the rules.
>> i created one jsp , jsp call servlet, In servelt i called the below piece
>> of
>> code in servlet but not executing
>>
>> I am trying to include it this piece of code into webapplication (in
>> servlet
>> or jsp) it is showing error.
>>
>> public static final void runMain() {
>>try {
>>RuleAgent agent =
>> RuleAgent.newRuleAgent("/guvnor.properties");
>>RuleBase ruleBase = agent.getRuleBase();
>>WorkingMemory workingMemory = ruleBase.newStatefulSession();
>>FactType ft= ruleBase.getFactType("sample.person");  //created
>> declarative model in guvnor
>>Object obj=ft.newInstance();
>>ft.set(obj,"age", 67);
>> //setting data into into person
>>ft.set(obj, "income", 1000);
>>workingMemory.insert(obj);
>>workingMemory.fireAllRules();
>>System.out.print(ft.get(obj, "age"));
>>System.out.print(ft.get(obj, "income"));
>>  } catch (Throwable t) {
>>t.printStackTrace();
>>}
>>}
>>
>>
>> 12:46:44,409 ERROR [STDERR] RuleAgent(default) INFO (Mon Dec 05 12:46:44
>> GMT
>> 2011): Configuring with
>>  newInstance=false, secondsToRefresh=-1
>> 12:46:44,419 ERROR [STDERR] RuleAgent(default) INFO (Mon Dec 05 12:46:44
>> GMT
>> 2011): Configuring pack
>> age provider : URLScanner monitoring URLs:
>> http://localhost:8082/guvnor-5.2.0.Final-jboss-as-5.1/or
>> g.drools.guvnor.Guvnor/package/sample/LATEST
>> 12:46:44,669 INFO  [STDOUT] INFO  05-12 12:46:44,669
>> (NilAuthenticator.java:authenticate:35) All
>>  users are guests.
>>
>>
>> 12:46:44,359 ERROR [STDERR] java.lang.IllegalArgumentException: Could not
>> parse knowledge.
>> 12:46:44,359 ERROR [STDERR] at
>> com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:115)
>> 12:46:44,359 ERROR [STDERR] at
>> com.sample.DroolsTest.FireRools(DroolsTest.java:62)
>> 12:46:44,359 ERROR [STDERR] at p1.Login.doGet(Login.java:37)
>> 12:46:44,359 ERROR [STDERR] at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
>> 12:46:44,359 ERROR [STDERR] at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>
>>
>> 12:46:44,699 ERROR [STDERR] RuleAgent(default) EXCEPTION (Mon Dec 05
>> 12:46:44 GMT 2011): org.drools.
>> rule.Package; local class incompatible: stream classdesc serialVersionUID
>> =
>> 510, local class serialV
>> ersionUID = 400. Stack trace should follow.
>> 12:46:44,699 ERROR [STDERR] java.io.InvalidClassException:
>> org.drools.rule.Package; local class inco
>> mpatible: stream classdesc serialVersionUID = 510, local class
>> serialVersionUID = 400
>> 12:46:44,699 ERROR [STDERR] at
>> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562
>> )
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Calling-drools-into-the-Web-Application-tp3561362p3561362.html
>> Sent from the Drools: User forum mailing list archive at Nabble.com.
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
>
> 
> Jackson Cunha Cassimiro (CereB)
> Bacharel em Ciencia da Computação - UFPI
> MSN: jackson.ce...@gmail.com
> Telefone Móvel +55 86 9928 1251
> Analista de Sistemas - Infoway - http://www.infoway-pi.com.br
> Mis

Re: [rules-users] Web client-side rule testing - best practices

2011-12-05 Thread Wolfgang Laun
Perhaps it's helpful - here's the
linkto
the paper backing my talk at this year's Rule
Fest . Section 4 is about data validation.

-W


2011/12/5 Ronald Albury 

> I have always thought of Drools-like systems being server-side engines -
> and we have many server-side-only uses for rules.  However, for a good user
> experience you should do checking as close to data entry as possible, and
> there is a subset of our server rules that are redundant with the rules
> governing client data entry (currently embedded in the Web interface as
> Javascript).
>
> Has anyone established a good pattern for using Drools for client-side
> testing?  I'm guessing that we would need some sort of per-field Ajax
> communication back to the server ... but this means per-field communication
> (not good for our agents on dial-up or with slow links), and it also means
> structuring our rules such that we can easily access only the appropriate
> rules.
>
> Would I, for instance, need a separate Fact object type for each field?
> This seems like it would really complicate the rules - we have about a
> dozen basic data structures for our server-side Facts, and each data
> structure will have multiple attributes.  I don't look forward to dealing
> with a couple hundred Fact types.
>
> Would I need some sort of flag on our data structures to include in the
> Fact which restricts the testing to only the field that was just entered?
> This would seem to complicate the understanding of our rules.  Some rules
> (even UI rules) depend on a combination of facts - so would it be a 'set'
> of flags?  This seems to be moving close to the first idea (separate Fact
> object types ... which seems more efficient).
>
> So ... as you can see, I am thrashing about a bit trying to find the
> correct pattern.  Can someone save me a bunch of time and bad code by
> sharing their best practice with me?
>
> Thanks,
>Ron
>
> ___
> 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] Drools integration common practice

2011-12-05 Thread ronalbury
I am a complete newbie, but have seen several things written about using
Apache Camel for integration in situations similar to those you describe.

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Drools-integration-common-practice-tp3561614p3562110.html
Sent from the Drools: User forum 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] Web client-side rule testing - best practices

2011-12-05 Thread ronalbury
I thought I should clarify something.  I am not looking for Drools to deal
with such UI-specific issues as enabling and disabling fields, what screen
to show next, etc.

Rather, we are developing a rich set of rules on the server to validate
fully populated data structures that we get from multiple sources.  There is
a subset of those rules which apply to the UI (e.g. regular expression,
value ranges, etc).  I am trying to: a) avoid having multiple versions of
the rules (one for the server and a different one, in Javascript, for the
client); b) avoid waiting until the user submits the data to the server to
provide them feedback from the shared rules.

The question is, are there best practices for: a) designing the rules such
that they can handle both cases (field validation and record validation); b)
connecting the Web browser to the server (e.g. Ajax) to support this
testing.

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Web-client-side-rule-testing-best-practices-tp3561732p3562156.html
Sent from the Drools: User forum 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] 'else' in rule

2011-12-05 Thread ronalbury
Please consider the possibility of

When

Then

When

Then

Else

--
View this message in context: 
http://drools.46999.n3.nabble.com/else-in-rule-tp3264337p3562187.html
Sent from the Drools: User forum 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] Want help with Resource Scanner though not using changeSets

2011-12-05 Thread starfish15
As such we are not using GUVNOR in the runtime for rules. We simply have the
PKG files. Create them using GUVNOR, and then save the binary PKG files in
our environment to run the rules. 

Since we r not using GUVNOR, we cant use Resource Scanner to know the
updated PKG files. Also we want to run the rules w/o a server re-start whn
the rules are further modified.

Any assistance in the same will be highly appreciated.

Regards,
starfish

--
View this message in context: 
http://drools.46999.n3.nabble.com/Want-help-with-Resource-Scanner-though-not-using-changeSets-tp3562282p3562282.html
Sent from the Drools: User forum 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] Want help with Resource Scanner though not using changeSets

2011-12-05 Thread Michael Anstis
Is there not a file scanner too that can be used with a KnowledgeAgent?

I also recall there being some talk (reasonably) recently about the
Resource scanner being able to use FILE URLs. Have you tried?

With kind regards,

Mike

On 5 December 2011 19:20, starfish15  wrote:

> As such we are not using GUVNOR in the runtime for rules. We simply have
> the
> PKG files. Create them using GUVNOR, and then save the binary PKG files in
> our environment to run the rules.
>
> Since we r not using GUVNOR, we cant use Resource Scanner to know the
> updated PKG files. Also we want to run the rules w/o a server re-start whn
> the rules are further modified.
>
> Any assistance in the same will be highly appreciated.
>
> Regards,
> starfish
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Want-help-with-Resource-Scanner-though-not-using-changeSets-tp3562282p3562282.html
> Sent from the Drools: User forum 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Web client-side rule testing - best practices

2011-12-05 Thread ronalbury
Here's what I'm coming up with on my own.

I have a dozen PoJo's for my server record structure, and I am subclassing
them all off of an abstract class that has: 
/private HashSet modified = new HashSet();
private boolean allFields = false;

public boolean fieldWasModified(String name) {
boolean result;

result = allFields || modified.contains(name);
return result;
}

protected void markModified(String name) {
String fieldName = name;

if (name.startsWith("this.")) {
fieldName = name.substring(5);
}
modified.add(fieldName);
}

public void markAllModified() {
allFields = true;
}/


I have modified the 'setter' template in the PoJo project to generate calls
to markModified:
/${field} = ${param};
setModified("${field}");/

My rules now test if a field is modified:
/rule "XmAddress city RegExp"
when
$a : XmAddress(fieldWasModified("city") 
&& city not matches "^[A-Za-z ]{1,25}$")  
then
$a.addError(drools.getRule().getName(), "Invalid city");
end/

The Web client will use Ajax to create a new object and set record
attributes, as appropriate, and then call the rules.
At the end when I submit the entire record for testing on the server, I
first call markAllModified.

I understand that this will not handle cross-field rules (unless I include
both fields in the Ajax call), but it seems like it will handle most of my
standard data entry edits in a consistent manner across the UI and the
server.

Please provide feedback ... remember I'm a newbie so please make your
criticism constructive.

Thanks


--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Web-client-side-rule-testing-best-practices-tp3561732p3562649.html
Sent from the Drools: User forum 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] 'else' in rule

2011-12-05 Thread Mark Proctor
On 05/12/2011 18:43, ronalbury wrote:
> Please consider the possibility of
>
> When
>
> Then
>
> When
>
> Then
>
> Else
It's already specced up in "relational data flows" which allows a 
tree-like data flow for your decision:
http://community.jboss.org/wiki/RelationalDataFlows

I hope that it, or a variation on it, is delivered in 2012.

Mark
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/else-in-rule-tp3264337p3562187.html
> Sent from the Drools: User forum 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Planner 5.3.Final - "presumedScore is corrupted" when using "update" on the rules working memory => shadow proxies problems?

2011-12-05 Thread guyramirez
Still the same issue, starting with the construction heuristic phase. Please
let me know if you need more explanations in what I am trying to do.

Here is the error. Please note that there is only one planning entity
(ShiftAssignment) object instance in this test.

Total Staffing required: 8
2011-12-05 22:21:49,627 [main] INFO  Solver started: time spend (0), score
(null), new best score (null), random seed (0).
ShiftAssignment: emp. id: 10 [st: 100, dur: 3]
ShiftAssignment: emp. id: 10 [st: 100, dur: 2]
ShiftAssignment: emp. id: 10 [st: 100, dur: 4]
ShiftAssignment: emp. id: 10 [st: 100, dur: 1]
2011-12-05 22:21:49,678 [main] TRACE Building ConstraintOccurrence summary
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
101, position id: 1, staffingRequired: 2, [ShiftAssignment: emp. id: 10 [st:
100, dur: 1]]]=1)
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
103, position id: 1, staffingRequired: 2, []]=2)
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
102, position id: 1, staffingRequired: 2, []]=2)
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
100, position id: 1, staffingRequired: 2, [ShiftAssignment: emp. id: 10 [st:
100, dur: 1], ShiftAssignment: emp. id: 10 [st: 100, dur: 1]]]=0)
2011-12-05 22:21:49,678 [main] TRACE Building ConstraintOccurrence summary
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
101, position id: 1, staffingRequired: 2, []]=2)
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
103, position id: 1, staffingRequired: 2, []]=2)
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
100, position id: 1, staffingRequired: 2, [ShiftAssignment: emp. id: 10 [st:
100, dur: 1]]]=1)
2011-12-05 22:21:49,678 [main] TRACE Adding ConstraintOccurrence
(intervalRequirementCovered/NEGATIVE_HARD:[IntervalRequirement: interval:
102, position id: 1, staffingRequired: 2, []]=2)
Exception in thread "main" java.lang.IllegalStateException: The
presumedScore (-5hard/-1soft) is corrupted because it is not the realScore 
(-7hard/-1soft).
Presumed workingMemory:
  Score rule (intervalRequirementCovered) has count (4) and weight total
(5).
Real workingMemory:
  Score rule (intervalRequirementCovered) has count (4) and weight total
(7).

at
org.drools.planner.core.solution.director.DefaultSolutionDirector.assertWorkingScore(DefaultSolutionDirector.java:157)
at
org.drools.planner.core.solver.DefaultSolverScope.assertWorkingScore(DefaultSolverScope.java:105)
at
org.drools.planner.core.phase.AbstractSolverPhaseScope.assertWorkingScore(AbstractSolverPhaseScope.java:132)
at
org.drools.planner.core.constructionheuristic.greedyFit.decider.DefaultGreedyDecider.decideNextStep(DefaultGreedyDecider.java:65)
at
org.drools.planner.core.constructionheuristic.greedyFit.DefaultGreedyFitSolverPhase.solve(DefaultGreedyFitSolverPhase.java:62)
at
org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:166)
at
org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:138)
at 
com.lfsoscience.planner.LfsoPlannerMain.execute(LfsoPlannerMain.java:36)
at com.lfsoscience.planner.LfsoPlannerMain.main(LfsoPlannerMain.java:27)



The drl:
rule "intervalRequirementCovered"
when
$intervalReq : IntervalRequirement($interval : interval, 
$position :
position, $staffingRequired : staffingRequired)
$matchingShiftAssignments : ArrayList( size <= $staffingRequired )
from 
collect ( ShiftAssignment(shiftStartTime <= $interval,
shiftEndTime > $interval, position == $position) )
then 
#actions
insertLogical(new 
IntConstraintOccurrence("intervalRequirementCovered",
ConstraintType.NEGATIVE_HARD,
$staffingRequired - 
$matchingShiftAssignments.size(),
$intervalReq, 
$matchingShiftAssignments));
end
rule "hardConstraintsBroken"
salience -1 // Do the other rules first (optional, for performance)
when
$hardTotal : Number() from accumulate(
IntConstraintOccurrence(constraintType ==
ConstraintType.NEGATIVE_HARD, $weight : weight), sum($weight)
)
then
scoreCalculator.setHardConstraintsBroken($hardTotal.intValue());
end
rule "softCon

Re: [rules-users] Calling drools into the Web Application.

2011-12-05 Thread srinivasasanda
Thank's u for ur suggestion, I will check overit.
I am using guvnor-5.2.1 and drools 5.2.0 
now i will try with guvnor 5.3 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Calling-drools-into-the-Web-Application-tp3561362p3563448.html
Sent from the Drools: User forum 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] How can I get rule's agenda group name?

2011-12-05 Thread srinivasasanda
Hi Zhao,

I'm also strucked here.I'm unable to retrieve agenda group names.Did
you succeeded in getting those rule names??If so,please guide me in
retrieving the agenda group names.Thanks in Advance.



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-can-I-get-rule-s-agenda-group-name-tp3508539p3563539.html
Sent from the Drools: User forum 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] Dynamic Fact(field) Generation in Declarative Model

2011-12-05 Thread srinivasasanda
Hi David,

 Let me explain our requirement in a better picture through the
images.Image1: http://drools.46999.n3.nabble.com/file/n3563593/Capture.png 

Now,My requirement is to add new field.For this,as shown in the below
image Image2:
http://drools.46999.n3.nabble.com/file/n3563593/Capture11.png  I would add
the field by "Add Field" option located in that respective model(as shown in
the Image2).

Our requirement is to add these fields using our Application front end into
the Drools Engine. We are looking for some APIs exposed by Drools to create
these facts from Portal Application.

I thank you for advising me and giving suggestions so far.

Thanks 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Dynamic-Fact-field-Generation-in-Declarative-Model-tp3545088p3563593.html
Sent from the Drools: User forum 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] Dynamic Fact(field) Generation in Declarative Model

2011-12-05 Thread Michael Anstis
Guvnor's screens to define a declarative Fact Model simply generate DRL.

Guvnor isn't as dynamic as the use-case you describe and hence we don't
have the same issues.

The API is what has already been discussed: create a DRL, use
KnowledgeBuilder or KnowledgeAgent to load these resources into your
application.

There is a private API in Guvnor used to transform its model into DRL. If
this is what you seek please advise and I'll dig out some class names.

With kind regards,

Mike

On 6 December 2011 06:28, srinivasasanda  wrote:

> Hi David,
>
> Let me explain our requirement in a better picture through the
> images.Image1: http://drools.46999.n3.nabble.com/file/n3563593/Capture.png
>
>Now,My requirement is to add new field.For this,as shown in the below
> image Image2:
> http://drools.46999.n3.nabble.com/file/n3563593/Capture11.png  I would add
> the field by "Add Field" option located in that respective model(as shown
> in
> the Image2).
>
> Our requirement is to add these fields using our Application front end into
> the Drools Engine. We are looking for some APIs exposed by Drools to create
> these facts from Portal Application.
>
> I thank you for advising me and giving suggestions so far.
>
> Thanks
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Dynamic-Fact-field-Generation-in-Declarative-Model-tp3545088p3563593.html
> Sent from the Drools: User forum 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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users