[rules-users] Retrieve values from a Map

2010-08-10 Thread Manav
I am new to drools and currently using version 5.1 for my testing. 

I am facing an issue with retrieving a value from Map if a key is present 

In my drl if i do this 

$c : Client (language contains "Japanese" , lang : language -> 
(language.get("Japanese").equals("Expert")))

it works ...but if i want to retrieve the value of the key i am not sure how to 
go about it . I tried various approaches but none of them worked 


i would like to do something like 

$c : Client (language contains "Japanese", $langValue : 
language.get("Japanese")) 


Can some one please guide me how to go about it . 

Regards,
Manav


  

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


Re: [rules-users] Drools Gunvor and Oryx integration

2010-08-10 Thread Patricia Bogoevici
Hello,

Thanks for your answer. I followed the steps provided, but I ran into other 
issues. Below is a short summary of what I did and issues that I ran into.

I re-created Evaluation.bpmn using the designer 
(localhost:8080/designer/editor), and I configured the task assignments as well 
to match the Evaluation.bpmn entirely. I exported the process definition as 
BPMN 2.0 DI xml file, and imported into Drools Eclipse workflow designer. All 
worked fine so far.

But, when I updated the process definition using Drools Eclipse designer, the 
process definition was modified by the plugin, and I lost all the assignment 
configuration. The modification I made was to rename the process id to 
something more friendly than the autogenerated name by the designer.

Here is an example for the SelfEvaluation task:
This is the structure created by the designer:

   
    
    
    krisv
    
    
    


This is how it looks after the Drools Eclipse plugin modifies it:

 
  
    
    
    
    
  
    

Basically, Drools Eclipse plugin re-wrote all the BPMN 2.0 elements to match to 
what Drools engine supports, and I lost all my configuration as result of that.

Next step was to try both of these process definitions in Guvnor/Designer. I 
seems that Guvnor does not load the BPMN definition into the designer unless 
its name is Evaluation. I uploaded my 2 Evaluation definitions: the one named 
EvaluationOryx.bpmn (as I created with the designer), and 
EvaluationEclipse.bpmn (the modified Evaluation by the Drools Eclipse plugin 
that removed the assignment configuration), but these 2 were not open using the 
designer, but instead displayed the option to download or upload a new version. 
I did try to open the original Evaluation.bpmn that comes in the sample package 
using the designer, but it opened the designer empty, as there are issues with 
opening that diagram. However, I tried to use the import button, to re-create 
it, but import does not work.

To sum up, the main issue I see here, is that there seem to be too many 
differences for the BPMN 2.0 implementation between Drools engine and the Oryx 
designer. 

Thanks again for all the help,
--Patricia

--- On Fri, 8/6/10, Han Ming Low  wrote:

From: Han Ming Low 
Subject: Re: [rules-users] Drools Gunvor and Oryx integration
To: "Rules Users List" 
Date: Friday, August 6, 2010, 4:59 AM

Hi,
 
The reason is that the Evaluation.bpmn is 2.0 while the version supported by 
oryx is 2.0 beta.
Thus, Drools is more advance compare to oryx.
 
But as for running the bpmn, drools engine can still do it.
 
In order to have a version that will open up both in drools and oryx, you can 
try the following
1) goto http://localhost:8080/designer/editor
2) create your own process 
3) use the export button to either show or download a BPMN 2.0 DI XML
4) now you have a bpmn file that can be used by drools and oryx in drools which 
you can upload as the Evaluation.bpmn
 
Hope this helps.
 
 
Han Ming


2010/8/6 Patricia Bogoevici 





Hi,


I followed the steps provided but the Evaluation.bpmn file does not load 
correctly into the Oryx editor. Looking into the logs, it seems like Oryx 
complains because the BPMN schema  namespace is different from what it expects. 
While Drools is using this: http://www.omg.org/spec/BPMN/20100524, Oryx editor 
is expecting this: http://schema.omg.org/spec/BPMN/2.0.


Stack trace snippet:
ERROR [STDERR] javax.xml.bind.UnmarshalException: unexpected element 
(uri:"http://www.omg.org/spec/BPMN/20100524/MODEL";, local:"definitions"). 
Expected elements are 
<{http://schema.omg.org/spec/BPMN/2.0}activityResource>,<{http://bpmndi.org}activityShape>,<{http://schema.omg.org/spec/BPMN/2.0}adHocSubProcess>

……


I changed the BPMN 2.0 schema for Evaluation.bpmn to match the one the designer 
expects, and imported the file manually into the designer 
(localhost:8080/designer/editor), to check if that fixed the problem. And it 
seems that fixed it, although, now I got a different error: 


2010-08-06 02:29:55,482 ERROR [STDERR] java.lang.IndexOutOfBoundsException: 
Index: 0, Size: 0
2010-08-06 02:29:55,482 ERROR [STDERR]     at 
java.util.ArrayList.RangeCheck(ArrayList.java:547)
2010-08-06 02:29:55,482 ERROR [STDERR]     at 
java.util.ArrayList.get(ArrayList.java:322)

2010-08-06 02:29:55,482 ERROR [STDERR]     at 
org.oryxeditor.server.BPMN2_0Importer.getJsonFromBpmn20Xml(BPMN2_0Importer.java:99)
2010-08-06 02:29:55,482 ERROR [STDERR]     at 
org.oryxeditor.server.BPMN2_0Importer.doPost(BPMN2_0Importer.java:66)

……


What I changed to Evaluation.bpmn was the root element which is now:

http://www.jboss.org/drools";

 typeLanguage="http://www.java.com/javaTypes";
 expressionLanguage="http://www.mvel.org/2.0";

 xmlns="http://schema.omg.org/spec/BPMN/2.0";
 xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";

 xs:schemaLoca

Re: [rules-users] Drools BPMN 2.0 service task error for process editedusing Oryx

2010-08-10 Thread Patricia Bogoevici
Hello,

Thanks for your answer. I read more about the work item, and how to use that in 
Drools.

Coming back to my example, I added the operationRef to the service task, and I 
added the interface element to specify the operation. There was a minor error, 
as if I add the interface after the process element is defined, is still 
complaining with the same error I posted originally. But if I move the 
interface element before the process element is defined, is working fine. So, 
that fixed my initial problem with the service task. 

But I ran into an issue regarding gateway direction. Drools does not implement 
the gateway direction mixed and I have one of that gateway in my test scenario. 
I tried to think of how to modify my process to not use mixed gateway 
direction, but it is not easy. I can add some extra steps but that does not 
make sense all the time, or to add extra converging gateways.  
Is any workaround to this that you can recommend? Do you intend to implement 
mixed gateway direction in the next releases?

Also, I have another question regarding business task. In Drools, one can 
specify the ruleflow-group for a business rule task. I wonder why I cannot 
specify a rule name as well. I can see the benefits of using ruleflow-group, 
but I also see the benefits of being able to specify a rule name directly, i.e. 
call a decision table, it is easier to specify the decision table file name, 
than to add a ruleflow-group. It does not add a lot of benefit to the overall 
process, but it seems more easier.

Thanks again,
Patricia

--- On Fri, 8/6/10, Kris Verlaenen  wrote:

From: Kris Verlaenen 
Subject: Re: [rules-users] Drools BPMN 2.0 service task error for process 
editedusing Oryx
To: "Rules Users List" 
Date: Friday, August 6, 2010, 9:26 AM



 
 

Patricia,
 
Note that the service task should contain an 
operationRef that refers to an operation defined as part of an interface in 
your 
process.  The process would probably open fine if you included that 
element, though I must admit that it should probably be able to handle 
incomplete process specifications as well (but this is still work in progress, 
especially since Oryx is still using the old BPMN 2.0 beta1 
format).
 
Note that the service task concept in BPMN2 matches 
with the work item node in Drools Flow.  So while the editor contains 2 
predefined service tasks, is it possible to define your own, as explained in 
the 
documentation here:
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-flow/html/ch.Domain_Specific_Processes.html
 
Kris
 

  - Original Message - 
  From: 
  Patricia Bogoevici 
  To: Rules Users List 
  Sent: Tuesday, August 03, 2010 9:47 
  PM
  Subject: [rules-users] Drools BPMN 2.0 
  service task error for process editedusing Oryx
  

  


  Hi all,

I am using Drools 5.1 release, and I am 
testing the BPMN process definition created with Oryx designer. The 
main 
problem I ran into is the serviceTask element. I cannot open the  
process file created with Oryx designer, in Eclipse, as it complains 
about this error:

"java.lang.IllegalArgumentException: No 
interfaces found at 

org.drools.bpmn2.legacy.beta1.ServiceTaskHandler.handleNode(ServiceTaskHandler.java:35)"
 


Below is a snippet from the BPMN 2.0 xml file got using Oryx for 
serviceTask. I also attached the whole xml file, in case that help. 


I appreciate a lot if someone can help me with this issue, as I 
am practically stuck at this point. 

On the other hand, I noticed 
that Drools Eclipse workflow editor allows only for 2 types of service 
tasks: Email and Log. Is that a limitation of the Eclipse workflow 
editor, or the serviceTask is not implemented in Drools BPMN 2.0? 

Can I use serviceTask BPMN 2.0 element in Drools workflow? 



** serviceTask from Oryx process 
**



Thanks in 
advance,
Patricia


  
  

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


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm for more 
information.
 



-Inline Attachment Follows-

___
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-10 Thread Mark Proctor

 On 10/08/2010 19:53, David Conde wrote:
Just to let people know, I've worked around this by only creating one 
SessionConfig object and caching it i.e "StatelessKnowledgeSession 
ksession = 
kbase.newStatelessKnowledgeSession((KnowledgeSessionConfiguration)getSessionConfig());". 



What seemed to be happening was ChainedProperties was trying 
Classloader lookups that were very slow when running in an OSGi 
environment.


Also with how the OSGi bundles are built the org.drools package is 
split and it makes it difficult to load up certain classes. I ended up 
having to use reflection to load up the SessionConfiguration class 
from a specific bundle. Maybe it's to do with how I'm importing the 
drools bundles into my project but it's one to watch out for if your 
using drools with OSGi.
in general you shouldn't be looking up concrete implementations, just 
using what the factory services provide in drools-api; so the split 
packages shouldn't impact. I made a few of the services avaiable as osgi 
factory services, see docs for more details.


Mark


Thanks,
Dave

On 10 August 2010 17:46, David Conde > wrote:


ChainedProperties lives in org.drools.util.ChainedProperties and
is created in SessionConfiguration(). The call is called
during StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession();.


On 10 August 2010 17:36, Pavel Tavoda mailto:pavel.tav...@gmail.com>> wrote:

Can't you avoid using ChainedProperties, what is it? Can you send
piece of code where you create session?

Pavel


2010/8/10 David Conde mailto:dco...@calomtech.com>>:
> Hi Pavel,
> I've changed it over to use a stateless session and I'm
seeing the
> same behavior. I've done some debugging and it seems to be
very slow loading
> up the SessionConfiguration due to all of the loading that
happens in
> ChainedProperties.
> Thanks,
> Dave
>
> On 10 August 2010 13:53, Pavel Tavoda
mailto:pavel.tav...@gmail.com>> wrote:
>>
>> Interesting. Normally it should be fast. Try to change your
patter and
>> load binary compiled serialized package from disk. You can
find it in
>> documentation.
>> Also consider using stateless session. Do you really need
stateful
>> session?
>>
>> Pavel
>>
>> 2010/8/9 David Conde mailto:dco...@calomtech.com>>:
>> > 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 mailto:dco...@calomtech.com>>
>> > Date: 9 August 2010 11:17
>> > Subject: Re: [rules-users] CPU Spike creating a
StatefulKnowledgeSession
>> > using OSGi
>> > To: Rules Users List mailto:rules-users@lists.jboss.org>>
>> >
>> >
>> > The line that it spikes on is StatefulKnowledgeSession
ksession =
>> > kbase.newStatefulKnowledgeSession();.
>> > Cheers,
>> > Dave
>> >
>> > On 9 August 2010 11:09, Pavel Tavoda
mailto:pavel.tav...@gmail.com>> wrote:
>> >>
>> >> Is it session creation or rule compilation?
>> >>
>> >> Pavel
>> >>
>> >> 2010/8/9 David Conde mailto:dco...@calomtech.com>>:
>> >> > 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

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

2010-08-10 Thread Mark Proctor

 On 10/08/2010 17:22, David Conde wrote:

Hi Pavel,

I've changed it over to use a stateless session and I'm seeing the 
same behavior. I've done some debugging and it seems to be very slow 
loading up the SessionConfiguration due to all of the loading that 
happens in ChainedProperties.

it could well be that.

When looking for property we search the available classpaths. With OSGi 
you have to add a lot of classpaths to it, so it searches them all...


Other than telling it not to search the classpath for .properties files, 
not sure what else we can do here...


Mark


Thanks,
Dave

On 10 August 2010 13:53, Pavel Tavoda > wrote:


Interesting. Normally it should be fast. Try to change your patter and
load binary compiled serialized package from disk. You can find it in
documentation.
Also consider using stateless session. Do you really need stateful
session?

Pavel

2010/8/9 David Conde mailto:dco...@calomtech.com>>:
> 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 mailto:dco...@calomtech.com>>
> Date: 9 August 2010 11:17
> Subject: Re: [rules-users] CPU Spike creating a
StatefulKnowledgeSession
> using OSGi
> To: Rules Users List mailto:rules-users@lists.jboss.org>>
>
>
> The line that it spikes on is StatefulKnowledgeSession ksession =
> kbase.newStatefulKnowledgeSession();.
> Cheers,
> Dave
>
> On 9 August 2010 11:09, Pavel Tavoda mailto:pavel.tav...@gmail.com>> wrote:
>>
>> Is it session creation or rule compilation?
>>
>> Pavel
>>
>> 2010/8/9 David Conde mailto:dco...@calomtech.com>>:
>> > 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
>
>

___
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-10 Thread David Conde
Just to let people know, I've worked around this by only creating one
SessionConfig object and caching it i.e "StatelessKnowledgeSession ksession
=
kbase.newStatelessKnowledgeSession((KnowledgeSessionConfiguration)getSessionConfig());".

What seemed to be happening was ChainedProperties was trying Classloader
lookups that were very slow when running in an OSGi environment.

Also with how the OSGi bundles are built the org.drools package is split and
it makes it difficult to load up certain classes. I ended up having to use
reflection to load up the SessionConfiguration class from a specific bundle.
Maybe it's to do with how I'm importing the drools bundles into my project
but it's one to watch out for if your using drools with OSGi.

Thanks,
Dave

On 10 August 2010 17:46, David Conde  wrote:

> ChainedProperties lives in org.drools.util.ChainedProperties and is created
> in SessionConfiguration(). The call is called
> during StatelessKnowledgeSession ksession =
> kbase.newStatelessKnowledgeSession();.
>
>
> On 10 August 2010 17:36, Pavel Tavoda  wrote:
>
>> Can't you avoid using ChainedProperties, what is it? Can you send
>> piece of code where you create session?
>>
>> Pavel
>>
>>
>> 2010/8/10 David Conde :
>> > Hi Pavel,
>> > I've changed it over to use a stateless session and I'm seeing the
>> > same behavior. I've done some debugging and it seems to be very slow
>> loading
>> > up the SessionConfiguration due to all of the loading that happens in
>> > ChainedProperties.
>> > Thanks,
>> > Dave
>> >
>> > On 10 August 2010 13:53, Pavel Tavoda  wrote:
>> >>
>> >> Interesting. Normally it should be fast. Try to change your patter and
>> >> load binary compiled serialized package from disk. You can find it in
>> >> documentation.
>> >> Also consider using stateless session. Do you really need stateful
>> >> session?
>> >>
>> >> Pavel
>> >>
>> >> 2010/8/9 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
>> >> >
>> >> >
>> >>
>> >> ___
>> >> 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
>>
>
>
>
> --
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Disting and group by

2010-08-10 Thread vijrams

Hi 

i have an object customer (purchaseDate, CustNo, Amount)

i need to find the customers who purchased more than X amount in each date)
ie group by customer then group by date and then sum of amount


how do you write a rule for this 

thanks
Vijay
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Disting-and-group-by-tp1076615p1076615.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] Matching items based on values in lists

2010-08-10 Thread cortlander

Thanks, Wolfgang.

I was missing a parenthesis:
...from $resource.getRqAttribs()

Now it runs and gives the desired result.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Matching-items-based-on-values-in-lists-tp1075556p1076317.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] Matching items based on values in lists

2010-08-10 Thread Wolfgang Laun
On 10 August 2010 19:04, cortlander  wrote:
>
> Thanks very much Wolfgang - that was clumsy of me!
>
> I corrected a couple of other errors, my code now runs, but does not work.

Not firing as expected? Or in what other way does it not work?

> Am I approaching this correctly?

This sort of fact structure is not very well suited for RBS like Drools.

If "not firing" is the problem, I suggest that you add rules using a subset of
the conditions (e.g., the "subject" part, and the "resource" part) and see
what matches and whether ypur facts are really what you expect.

You might also change the second part to follow the same pattern as
the first part:
  $resource: RqTargetType( $resourceAttribs : rqAttribs )
  ... from $resourceAttribs
  ... from $resourceAttribs
but I don't think that matters except for readability.

-W

>
> rule "Patient Access Rule"
>        when
>                #conditions
>                RqTargetType( $subjectAttribs : rqAttribs )
>                RqAttrib (attribType == "subject", designator == 
> "subject.role",
>                        attribValue == "patient") from $subjectAttribs
>                RqAttrib (attribType == "subject", designator == "subject.id",
>                        $subjectId: attribValue) from $subjectAttribs
>
>                $resource: RqTargetType( )
>                RqAttrib (attribType == "resource", designator == 
> "resource.patient",
>                        attribValue == $subjectId ) from 
> $resource.getRqAttribs()
>                RqAttrib (attribType == "resource", designator == 
> "resource.id",
>                        $resourceId: attribValue ) from $resource.getRqAttribs
>        then
>                #actions
>                System.out.println( "resource: " + $resourceId );
>                System.out.println( "subject: " + $subjectId );
>                System.out.println( "Patient Access rule decision: Permit" );
>                decisions.add("Permit");
> end
>
> --
> View this message in context: 
> http://drools-java-rules-engine.46999.n3.nabble.com/Matching-items-based-on-values-in-lists-tp1075556p1076024.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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Matching items based on values in lists

2010-08-10 Thread cortlander

Thanks very much Wolfgang - that was clumsy of me!

I corrected a couple of other errors, my code now runs, but does not work.
Am I approaching this correctly?

rule "Patient Access Rule"
when
#conditions
RqTargetType( $subjectAttribs : rqAttribs )
RqAttrib (attribType == "subject", designator == 
"subject.role", 
attribValue == "patient") from $subjectAttribs  
RqAttrib (attribType == "subject", designator == "subject.id",
$subjectId: attribValue) from $subjectAttribs

$resource: RqTargetType( )
RqAttrib (attribType == "resource", designator == 
"resource.patient", 
attribValue == $subjectId ) from 
$resource.getRqAttribs()
RqAttrib (attribType == "resource", designator == 
"resource.id", 
$resourceId: attribValue ) from $resource.getRqAttribs
then 
#actions
System.out.println( "resource: " + $resourceId );
System.out.println( "subject: " + $subjectId );
System.out.println( "Patient Access rule decision: Permit" );
decisions.add("Permit");
end

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Matching-items-based-on-values-in-lists-tp1075556p1076024.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] Drools Pattern to Eat Real Exceptions

2010-08-10 Thread Mauricio Salatino
I think that the mixture of dynamic class creation and compilation for RHS
(nested and recursive code for pattern matching) and nested node execution
inside business processes complicate the exception propagation drastically.
Also it's important to note that the knowledge layer was added on top of the
rule engine in order to do an abstraction.
But you are right, sometimes it gets really complicated to find out what
it's happening.

On Tue, Aug 10, 2010 at 1:48 PM, tolitius  wrote:

>
> I am just curious to learn a little more about Drools evolution history to
> understand why would Drools eat so many Exceptions the root cause of which
> is impossible to even guess, without stepping into the Drools source
> code...
> That happens in many Drools components, so my curiosity just wanted to be
> fed on how this "pattern" came to be.
>
> Any old school Droolers can contemplate?
>
> /Anatoly
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Pattern-to-Eat-Real-Exceptions-tp1075763p1075763.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
>



-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

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


Re: [rules-users] Matching items based on values in lists

2010-08-10 Thread Wolfgang Laun
Seems you are missing the keyword "when":

rule "example"
when
   RqTargerType(...

-W

On 10/08/2010, cortlander  wrote:
>
> I am new to drools and have been struggling with this rule.
>
> $subject: RqTargetType contains a list of RqAttrib objects
> $resource: RqTargetType also contains its own list of RqAttrib objects
>
> $subject in a certain role has to be selected based on (attribType ==
> "subject", designator == "subject.role", attribValue == "patient")
> $subjectId is to be extracted from another attribute (attribType ==
> "subject", designator == "subject.id",$subjectId: attribValue)
>
> We then need to select a resource that has an attribute to match this
> $subjectId (attribType == "resource", designator == "resource.patient",
> attribValue == $subjectId )
>   
> Here is the rule I wrote:
>
> rule "Patient Access Rule"
>   #conditions
>   RqTargetType( $subjectAttribs : rqAttribs )
>   RqAttrib (attribType == "subject", designator == "subject.role",
>   attribValue == "patient") from $subjectAttribs  
>   RqAttrib (attribType == "subject", designator == "subject.id",
>   $subjectId: attribValue) from $subjectAttribs
>   
>   $resource: RqTargetType( )
>   RqAttrib (attribType == "resource", designator == 
> "resource.patient",
>   attribValue == $subjectId ) from 
> $resource.getRqAttribs()
>   RqAttribute (attribType == "resource", designator == 
> "resource.id",
>   $resourceId: attribValue ) from $resource.getRqAttribs
>   then
>   #actions
>   System.out.println( "resource: " + $resourceId );
>   System.out.println( "subject: " + $subjectId );
>   System.out.println( "Patient Access rule decision: Permit" );
>   decisions.add("Permit");
>   retract($subject);  
> end
>
> I keep on getting "no viable alternative at input" error.
> Tried stripping the code so that only the following was left and still got
> the error:
>   RqTargetType( $subjectAttribs : rqAttribs )
>   RqAttrib (attribType == "subject", designator == "subject.role",
>   attribValue == "patient") from $subjectAttribs  
> [ERR 101] Line 25:2 no viable alternative at input 'RqTargetType' in rule
> "Patient Access Rule"
>
> Then tried this with similar results.
>   $subject: RqTargetType()
>   $subjectAttrib: RqAttrib (attribType == "subject", designator ==
> "subject.role",
>   attribValue == "patient") from $subject.getRqAttribs()
> no viable alternative at input '$subject' in rule "Patient Access Rule"
>
> Any help will be much appreciated.
> Thank you and have a great day.
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/Matching-items-based-on-values-in-lists-tp1075556p1075556.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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools Pattern to Eat Real Exceptions

2010-08-10 Thread tolitius

I am just curious to learn a little more about Drools evolution history to
understand why would Drools eat so many Exceptions the root cause of which
is impossible to even guess, without stepping into the Drools source code...
That happens in many Drools components, so my curiosity just wanted to be
fed on how this "pattern" came to be.

Any old school Droolers can contemplate?

/Anatoly
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Pattern-to-Eat-Real-Exceptions-tp1075763p1075763.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-10 Thread David Conde
ChainedProperties lives in org.drools.util.ChainedProperties and is created
in SessionConfiguration(). The call is called
during StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession();.

On 10 August 2010 17:36, Pavel Tavoda  wrote:

> Can't you avoid using ChainedProperties, what is it? Can you send
> piece of code where you create session?
>
> Pavel
>
>
> 2010/8/10 David Conde :
> > Hi Pavel,
> > I've changed it over to use a stateless session and I'm seeing the
> > same behavior. I've done some debugging and it seems to be very slow
> loading
> > up the SessionConfiguration due to all of the loading that happens in
> > ChainedProperties.
> > Thanks,
> > Dave
> >
> > On 10 August 2010 13:53, Pavel Tavoda  wrote:
> >>
> >> Interesting. Normally it should be fast. Try to change your patter and
> >> load binary compiled serialized package from disk. You can find it in
> >> documentation.
> >> Also consider using stateless session. Do you really need stateful
> >> session?
> >>
> >> Pavel
> >>
> >> 2010/8/9 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
> >> >
> >> >
> >>
> >> ___
> >> 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
>



-- 
David Conde
CTO Calom Technologies

Mail: dco...@calomtech.com
Mobile: 00353 86 0623397

Calom Technologies Ltd (registered in Ireland)
Registered Number: 460246
Registered Address: NCI Research and Business Centre, Mayor St, IFSC, Dublin
1, Ireland
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Matching items based on values in lists

2010-08-10 Thread cortlander

I am new to drools and have been struggling with this rule.

$subject: RqTargetType contains a list of RqAttrib objects
$resource: RqTargetType also contains its own list of RqAttrib objects

$subject in a certain role has to be selected based on (attribType ==
"subject", designator == "subject.role", attribValue == "patient")
$subjectId is to be extracted from another attribute (attribType ==
"subject", designator == "subject.id",  $subjectId: attribValue)

We then need to select a resource that has an attribute to match this
$subjectId (attribType == "resource", designator == "resource.patient",
attribValue == $subjectId )

Here is the rule I wrote:

rule "Patient Access Rule"
#conditions
RqTargetType( $subjectAttribs : rqAttribs )
RqAttrib (attribType == "subject", designator == 
"subject.role", 
attribValue == "patient") from $subjectAttribs  
RqAttrib (attribType == "subject", designator == "subject.id",
$subjectId: attribValue) from $subjectAttribs

$resource: RqTargetType( )
RqAttrib (attribType == "resource", designator == 
"resource.patient", 
attribValue == $subjectId ) from 
$resource.getRqAttribs()
RqAttribute (attribType == "resource", designator == 
"resource.id", 
$resourceId: attribValue ) from $resource.getRqAttribs
then 
#actions
System.out.println( "resource: " + $resourceId );
System.out.println( "subject: " + $subjectId );
System.out.println( "Patient Access rule decision: Permit" );
decisions.add("Permit");
retract($subject);  
end

I keep on getting "no viable alternative at input" error.
Tried stripping the code so that only the following was left and still got
the error:
RqTargetType( $subjectAttribs : rqAttribs )
RqAttrib (attribType == "subject", designator == 
"subject.role", 
attribValue == "patient") from $subjectAttribs  
[ERR 101] Line 25:2 no viable alternative at input 'RqTargetType' in rule
"Patient Access Rule"

Then tried this with similar results.
$subject: RqTargetType()
$subjectAttrib: RqAttrib (attribType == "subject", designator ==
"subject.role", 
attribValue == "patient") from $subject.getRqAttribs()
no viable alternative at input '$subject' in rule "Patient Access Rule"

Any help will be much appreciated.
Thank you and have a great day.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Matching-items-based-on-values-in-lists-tp1075556p1075556.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-10 Thread Pavel Tavoda
Can't you avoid using ChainedProperties, what is it? Can you send
piece of code where you create session?

Pavel


2010/8/10 David Conde :
> Hi Pavel,
> I've changed it over to use a stateless session and I'm seeing the
> same behavior. I've done some debugging and it seems to be very slow loading
> up the SessionConfiguration due to all of the loading that happens in
> ChainedProperties.
> Thanks,
> Dave
>
> On 10 August 2010 13:53, Pavel Tavoda  wrote:
>>
>> Interesting. Normally it should be fast. Try to change your patter and
>> load binary compiled serialized package from disk. You can find it in
>> documentation.
>> Also consider using stateless session. Do you really need stateful
>> session?
>>
>> Pavel
>>
>> 2010/8/9 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
>> >
>> >
>>
>> ___
>> 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-10 Thread David Conde
Hi Pavel,

I've changed it over to use a stateless session and I'm seeing the
same behavior. I've done some debugging and it seems to be very slow loading
up the SessionConfiguration due to all of the loading that happens in
ChainedProperties.

Thanks,
Dave

On 10 August 2010 13:53, Pavel Tavoda  wrote:

> Interesting. Normally it should be fast. Try to change your patter and
> load binary compiled serialized package from disk. You can find it in
> documentation.
> Also consider using stateless session. Do you really need stateful session?
>
> Pavel
>
> 2010/8/9 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
> >
> >
>
> ___
> 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] npe in LogicalRetractCallback when using jpa persistence

2010-08-10 Thread Edson Tirelli
Chris,

I will look into this problem, but I am not sure how to reproduce it.
Maybe you can provide me a test case? If so, please open a JIRA, attached
your test case and ping me.

Thanks,
Edson


2010/8/10 Chris Raschl 

> Hi,
> Just in case someone faces the same problem, comments inline:
>
> Am 05.08.2010 13:53, schrieb Chris Raschl:
> > I'm using the latest drools and drools flow snapshot with jpa
> persistence.
> >
> > When I'm retracting a fact from the knowledge session (which causes
> > logical retraction), the session can't be persisted any more.
> >
> > During retraction a LogicalRetractCallback is instantiated using this
> > constructor:
> >
> > public LogicalRetractCallback(final TruthMaintenanceSystem tms,
> > final LogicalDependency node,
> > final Set set,
> > final InternalFactHandle handle,
> > final PropagationContext context,
> > final Activation activation) {
> >   this.tms = tms;
> >   this.node = node;
> >   this.set = set;
> >   this.handle = handle;
> >   this.context = context;
> > }
> >
> > As you can see an activation object can be passed (and actually is
> > passed) to the constructor, but is never used. Retraction works though.
> >
> > The problem occurs when the knowledge session is persisted, because
> > LogicalRetractCallback.write assumes that activation is not null, which
> > leads to this npe:
> >
> > Caused by: java.lang.NullPointerException
> >
> org.drools.common.TruthMaintenanceSystem$LogicalRetractCallback.write(TruthMaintenanceSystem.java:251)
> >
> org.drools.marshalling.impl.OutputMarshaller.writeActionQueue(OutputMarshaller.java:201)
>
> Adding this.activation = activation to the constructor does not help,
> beause the npe in the write method remains. I tried it, then the whole
> expression "context.terminalTupleMap.get( this.activation.getTuple() )"
> in the write method evaluates to null...
>
> I found out persistence was triggered by an unneccessary flush in my
> code. I removed that, everything works now.
>
> That seems to be the case because the action queue is empty then and
> there's no need to persist it, thus the write method is never called. I
> guess the problem remains if someone tries to persist a session with an
> action queue containing a LogicalRetractCallback object.
>
> - chris
> ___
> 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


Re: [rules-users] drools in a SOA environment

2010-08-10 Thread Pavel Tavoda
Maybe this doesn't fit your needs but we are using very successfully
DroolsAdvice which intercept each service call with AspectJ. It's good
for auditing, generating mails for exceptional situations but also for
calculation fees on invoices. Here is source code for inspiration:
http://fisheye3.atlassian.com/browse/fornax/trunk/cartridges/sculptor/fornax-cartridges-sculptor-framework/src/main/java/org/fornax/cartridges/sculptor/framework/drools/DroolsAdvice.java?r=6407

Regards

Pavel

2010/8/10 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
>
>

___
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-10 Thread Pavel Tavoda
Interesting. Normally it should be fast. Try to change your patter and
load binary compiled serialized package from disk. You can find it in
documentation.
Also consider using stateless session. Do you really need stateful session?

Pavel

2010/8/9 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
>
>

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


Re: [rules-users] Drools Rule language resources Reg;

2010-08-10 Thread Mark Proctor


  
  
There is a wiki, but it's not that well maintained:
http://community.jboss.org/wiki/JBossRules

You can read any book on production rule systems and the examples
should translate pretty well. So I'd recommend the Jess book and
also the two Expert Systems books.

If you scroll down here you will see some books recommended:
http://jboss.org/drools/documentation.html
Jess in Action: Java Rule-based Systems
  Ernest Friedman-Hill
  ISBN: 1930110898
Expert Systems: Principles and Programming
  Joseph Giarratano, Gary D. Riley
  ISBN: 0534384471
Introduction to Expert Systems
  Peter Jackson
  ISBN: 0201876868
Smart Enough Systems
  James Taylour, Neil Raden
  Print ISBN-10: 0-13-234796-2
  Print ISBN-13: 978-0-13-234796-9


Mark
On 10/08/2010 12:26, Dieter D'haeyere wrote:
Resources I use:
  - the two Drools books from packt
  - The documentation that can be downloaded from the download site
  (surprise surprise ;)  )
  - Some interesting sites / blogs like: 
  * http://lucazamador.wordpress.com/
  * http://blog.athico.com/
  * http://www.plugtree.com
  
  That is where I found most of the information.
  If you know about any other good resources, I am interested to
  hear about them.
  
  Btw, I didn't find a Drools wiki or forum but the community is
  quite active :)
  
  Dieter D'haeyere.
  
  
  
  2010/8/10 Murali Venugopal 

   
Hi,
  
  Thanks for your prompt reply. Actually, I'm not into
  middle of writing some rules. I'm working to implement
  Drools in a NMS product. Where Root-Cause Analysis is done
  to identify the exact problem in a network.
  
  I'm initially working on a POC trying to identify pros and
  cons.
  The approximate scenarios include
  
timing window
generating new co-related events
escalation, and so on
  
  
  I'm not looking for a solution here. At least, I've not
  grown to that extent in Drools. I'm expecting someone to
  guide me. Is the resources I have is sufficient or is
  there some other resources available elsewhere?
  
  To be more precise, I want to the following
  
possible keywords in a .drl file
sematics
syntax, and
usage
  
  
  Regards,
   Murali Venugopal
  

   


On 08/10/2010 03:04 PM, Dieter D'haeyere wrote:
Maybe you could post an example
  of a rule you would like to define ...
  In that way, we can spot your exact problem better
  (and maybe see what kind of documentation is still
  lacking)
  Regards,
  Dieter D'haeyere.
  
  
  
  2010/8/10 Murali Venugopal 

   
Hi,
  
  I'm a newbie to Drools and Rules. I see this
  Mailing list provides lot of valuable
  information regarding Drools.
  Actually I'm looking for some good resources
  which helps in writing Rules. I.e Rule Syntax
  and Semantics. It's since 3 months I have
  started showing interest in Drools. But still
  I can't proceed more than the examples given
  in the books, which is not sufficient to work
  on real time projects.
  
  I'm referring books like
  1. Drools JBoss Rules 5.0
  2. JBoss Drools Business Rules
  also,
  1. Drools documentation and Manuals.
  
  But still there's no definitive guides for
  writing rules. The Drools Documentation has
  listed all the possible keywords. But, their
  Syntax and Semantics are missing.
  I went through this entire Mailing List hoping
  someone would have asked this question before
  me. But in vain. 
  
  So, please refer/poi

Re: [rules-users] Drools Rule language resources Reg;

2010-08-10 Thread Dieter D'haeyere
Resources I use:
- the two Drools books from packt
- The documentation that can be downloaded from the download site (surprise
surprise ;)  )
- Some interesting sites / blogs like:
* http://lucazamador.wordpress.com/
* http://blog.athico.com/
* http://www.plugtree.com

That is where I found most of the information.
If you know about any other good resources, I am interested to hear about
them.

Btw, I didn't find a Drools wiki or forum but the community is quite active
:)

Dieter D'haeyere.



2010/8/10 Murali Venugopal 

>
> Hi,
>
> Thanks for your prompt reply. Actually, I'm not into middle of writing some
> rules. I'm working to implement Drools in a NMS product. Where Root-Cause
> Analysis is done to identify the exact problem in a network.
>
> I'm initially working on a POC trying to identify pros and cons.
> The approximate scenarios include
>
>- timing window
>- generating new co-related events
>- escalation, and so on
>
>
> I'm not looking for a solution here. At least, I've not grown to that
> extent in Drools. I'm expecting someone to guide me. Is the resources I have
> is sufficient or is there some other resources available elsewhere?
>
> To be more precise, I want to the following
>
>- possible keywords in a .drl file
>- sematics
>- syntax, and
>- usage
>
>
> Regards,
> Murali Venugopal
>
>
>
> On 08/10/2010 03:04 PM, Dieter D'haeyere wrote:
>
> Maybe you could post an example of a rule you would like to define ...
> In that way, we can spot your exact problem better (and maybe see what kind
> of documentation is still lacking)
> Regards,
> Dieter D'haeyere.
>
>
>
> 2010/8/10 Murali Venugopal 
>
>>
>> Hi,
>>
>> I'm a newbie to Drools and Rules. I see this Mailing list provides lot of
>> valuable information regarding Drools.
>> Actually I'm looking for some good resources which helps in writing Rules.
>> I.e Rule Syntax and Semantics. It's since 3 months I have started showing
>> interest in Drools. But still I can't proceed more than the examples given
>> in the books, which is not sufficient to work on real time projects.
>>
>> I'm referring books like
>> 1. Drools JBoss Rules 5.0
>> 2. JBoss Drools Business Rules
>> also,
>> 1. Drools documentation and Manuals.
>>
>> But still there's no definitive guides for writing rules. The Drools
>> Documentation has listed all the possible keywords. But, their Syntax and
>> Semantics are missing.
>> I went through this entire Mailing List hoping someone would have asked
>> this question before me. But in vain.
>>
>> So, please refer/point me some good resources for Rules. Because in
>> Drools, I believe, everything is possible only through Rules.
>>
>> Thanks and Regards,
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
> ___
> rules-users mailing 
> listrules-us...@lists.jboss.orghttps://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] Drools Rule language resources Reg;

2010-08-10 Thread Murali Venugopal


  
  

Hi,
  
  Thanks for your prompt reply. Actually, I'm not into middle of
  writing some rules. I'm working to implement Drools in a NMS
  product. Where Root-Cause Analysis is done to identify the exact
  problem in a network.
  
  I'm initially working on a POC trying to identify pros and cons.
  The approximate scenarios include
  
timing window
generating new co-related events
escalation, and so on
  
  
  I'm not looking for a solution here. At least, I've not grown to
  that extent in Drools. I'm expecting someone to guide me. Is the
  resources I have is sufficient or is there some other resources
  available elsewhere?
  
  To be more precise, I want to the following
  
possible keywords in a .drl file
sematics
syntax, and
usage
  
  
  Regards,
  Murali Venugopal




On 08/10/2010 03:04 PM, Dieter D'haeyere wrote:
Maybe you could post an example of a rule you would
  like to define ...
  In that way, we can spot your exact problem better (and maybe see
  what kind of documentation is still lacking)
  Regards,
  Dieter D'haeyere.
  
  
  
  2010/8/10 Murali Venugopal 

   
Hi,
  
  I'm a newbie to Drools and Rules. I see this Mailing list
  provides lot of valuable information regarding Drools.
  Actually I'm looking for some good resources which helps
  in writing Rules. I.e Rule Syntax and Semantics. It's
  since 3 months I have started showing interest in Drools.
  But still I can't proceed more than the examples given in
  the books, which is not sufficient to work on real time
  projects.
  
  I'm referring books like
  1. Drools JBoss Rules 5.0
  2. JBoss Drools Business Rules
  also,
  1. Drools documentation and Manuals.
  
  But still there's no definitive guides for writing rules.
  The Drools Documentation has listed all the possible
  keywords. But, their Syntax and Semantics are missing.
  I went through this entire Mailing List hoping someone
  would have asked this question before me. But in vain. 
  
  So, please refer/point me some good resources for Rules.
  Because in Drools, I believe, everything is possible only
  through Rules.
  
  Thanks and Regards,
  
  
  
  ___
  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] Can't see process in gwt-console after changingguvnor to authenticator

2010-08-10 Thread Han Ming Low
Hi Kris,

Thanks for the reply.

Sorry for any confusion.
I found that I'm wrong to say that the process is not showing is due to
enabling the role base authorization.

I realize that, maybe I'm in a private network, when I first try to access
the "Process" view in Drools Flow console which will in turn try to query
http://localhost:8080/gwt-console-server/rs/process/definitions, it will
take a long time for the server to return the definition, might be because
of the xsd at
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools*
-api/src/main/resources/change-set-1.0.0.xsd
*
After a long wait, when the server return the result for definitions after
the first time, I will be able to see the Process.

Now, when I try to login to the Drools Flow console by loggin in as "john"
which I do not defined any User Permission at Guvnor, I'm still able to see
the "Evaluation" process.

Is it possible to restrict user "john" not to see the process that he is not
"defined" to see.

Regarding your suggestion on using changeset.xml, I'm sorry I'm not sure
what is required to be done.
I would thought that Drools Flow console is using the guvnor's authenticator
because after I change the guvnor-users.properties, say the password for
user "admin" is changed to "admin1", I managed to login to Drools Flow
console using the new password "admin1".
To me, it means that Drools Flow is actually now using
guvnor-users.properties for authentication.
(if I use the old password "admin" will encounter a "Authentication Failed"
error)
Just that now my problem is directly opposite to what I thought the problem
was first to be.
i.e.
I want the Process not to show when login using "john" but it is showing
instead.

Sorry for the confusion.

Any advice is greatly appreciated.

Thanks.


Han Ming
2010/8/6 Kris Verlaenen 

>  Han Ming,
>
> The gwt-console uses the authentication as defined in the ChangeSet.xml
> inside the drools-gwt-console-{version}.jar in the gwt server war:
>
>  type='PKG' basicAuthentication="enabled" username="admin" password="admin"
> />
>
> I guess you could change that or make sure the credential that is specified
> here works for your configuration, would that help?
>
> Kris
>
>
>   - Original Message -
> *From:* Han Ming Low 
> *To:* Rules Users List 
> *Sent:* Thursday, August 05, 2010 10:28 AM
> *Subject:* [rules-users] Can't see process in gwt-console after
> changingguvnor to authenticator
>
> Hi,
>
> I'm having problems with seeing the process in gwt-console. :p
>
> This time the difference is I change the guvnor components.xml
> authenticator to "other" and role based authorization as "true" and set the
> login-config.xml authentication to a users.properties
>
> The steps and difference in setup I have made is as follows
> 1) change guvnor and flow persistence to mysql instead of h2
> 2) Build defaultPackage, ABLE to see process in Drools Flow console
> 3) Shutdown both human task and jboss
> 4) Configure role-base authorization and users.properties file
> authentication
> 5) Start human.task and jboss
> 6) Not able to see process in Drools Flow console
> 7) Rebuild defaultPackage
> 8) Not able to see process in Drools Flow console
> 9) Restart both human task and jboss
> 10) Not able to see process in Drools Flow console
> 11) Delete process in guvnor and delete archive
> 12) Copy process from local file system to guvnor through WebDAV
> 13) Build defaultPackage
> 14) Not able to see process in Drools Flow console
> 15) Shutdown both human task and jboss
> 16) Change login back to defaultAuthenticator.authenticate
> 17) Start human.task and jboss
> 18) ABLE to see process again
>
> What should I do to allow the process to be seen when other authenticator
> is used?
> Any advice is greatly appreciated.
>
> Thanks.
>
>
> Han Ming
>
> --
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm for more
> information.
>
> ___
> 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] Instructions for upgrading designer.war?

2010-08-10 Thread Han Ming Low
Hi Kris,

Thanks for the list.

I was thinking if I can help to upgrade the new version of designer at
http://www.intalio.org/public/maven2/com/intalio/bpms/web/designer/1.0.0.016/
to be compatible with Drools.

If I have the skill, I wouldn't mind. :)

I'll try to see I can upgrade the designer to 1.0.0.016 for a start.

Cheers.


Han Ming





2010/8/6 Kris Verlaenen 

>  Han Ming,
>
> Here is the full list of changes that were made to the original war that is
> located here:
>
> http://www.intalio.org/public/maven2/com/intalio/bpms/web/designer/1.0.0.010/
>
> Note that most of the changes in the src dir (as described below) were to
> get the import/export functionality of Oryx working.  If you're serious
> about helping out, just let me know, there is lots you could help with, like
> improving the import/export for other cases, maybe updating to the BPMN 2.0
> beta 2 format, etc.
>
> Kris
>
> -- Changes --
>
> unzip in deploy folder, in folder designer.war
>
> in WEB-INF/web.xml, enable tomcat settings for DirectoryListingServlet
> removed WEB-INF/lib/javax.servlet-*.jar
> added slf4j-api and slf4j-jdk14 to WEB-INF/lib
>
> remove console.log statement from oryx.js
> replace enterprise-repository in oryx.js with drools-guvnor
>
> moved designer.war/lib/bpmn2 to designer.war/WEB-INF/lib/bpmn2
>
> small fragment in oryx.js in construct of ORYX.Editor for setting id as
> uuid
>
> remove "oryx_editor_header" init + ref from Oryx.js
>
> Replace some BPMN2 import/export classes in WEB-INF/classes:
>
> de/hpi/bpmn2_0/model/FlowElement.java
> de/hpi/bpmn2_0/model/activity/Task.java
> de/hpi/bpmn2_0/model/activity/type/BusinessRuleTask.java
> de/hpi/bpmn2_0/model/activity/type/ReceiveTask.java
> de/hpi/bpmn2_0/model/activity/type/SendTask.java
> de/hpi/bpmn2_0/model/activity/type/UserTask.java
> de/hpi/bpmn2_0/model/activity/type/ManualTask.java
> de/hpi/bpmn2_0/model/activity/type/ScriptTask.java
> de/hpi/bpmn2_0/model/activity/type/ServiceTask.java
> de/hpi/bpmn2_0/model/diagram/BpmnNode.java
> de/hpi/bpmn2_0/model/gateway/ComplexGateway.java
> de/hpi/bpmn2_0/model/gateway/ExclusiveGateway.java
> de/hpi/bpmn2_0/model/gateway/InclusiveGateway.java
> de/hpi/bpmn2_0/model/gateway/EventBasedGateway.java
> de/hpi/bpmn2_0/model/gateway/Gateway.java
> de/hpi/bpmn2_0/model/gateway/ParallelGateway.java
> de/hpi/bpmn2_0/transformation/BPMN2DiagramConverter.java
> de/hpi/bpmn2_0/model/gateway/Diagram2BpmnConverter.java
> org/oryxeditor/server/EditorHandler.java
> org/oryxeditor/server/diagram/JSONBuilder.java
>
>   - Original Message -
> *From:* Han Ming Low 
> *To:* rules-users@lists.jboss.org
> *Sent:* Wednesday, August 04, 2010 12:09 PM
> *Subject:* [rules-users] Instructions for upgrading designer.war?
>
> Hi,
>
> I understand that the designer.war is a project by intalio.
>
> When looking at the source for the war at
> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/contrib/designer/designer-src.war,
> I saw the changes to be made to make it compatible with Drools.
>
> I think I can do some of the steps like
> 1) changing the web.xml to use tomcat instead of jetty
> 2) added slf4j library
> 3) move lib/bpmn2 library to web-inf/lib
> 4) changes to oryx.js that involve
> - commenting out the header
> - commenting out the log
> - change the repository url from "/designer/uuidRepository?uuid="+ uuid to
> "/drools-guvnor/org.drools.guvnor.Guvnor/guvnorAPI?action=load&uuid="+ uuid
>
> However, I'm not sure what is the BPMN2 import/export classes to replace in
> WEB-INF/classes
>
> Can someone could tell me which are the classes?
> I can also help to update the designer. :)
>
> Thanks.
>
>
> Han Ming
>
> --
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm for more
> information.
>
> ___
> 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 Rule language resources Reg;

2010-08-10 Thread Dieter D'haeyere
Maybe you could post an example of a rule you would like to define ...
In that way, we can spot your exact problem better (and maybe see what kind
of documentation is still lacking)
Regards,
Dieter D'haeyere.



2010/8/10 Murali Venugopal 

>
> Hi,
>
> I'm a newbie to Drools and Rules. I see this Mailing list provides lot of
> valuable information regarding Drools.
> Actually I'm looking for some good resources which helps in writing Rules.
> I.e Rule Syntax and Semantics. It's since 3 months I have started showing
> interest in Drools. But still I can't proceed more than the examples given
> in the books, which is not sufficient to work on real time projects.
>
> I'm referring books like
> 1. Drools JBoss Rules 5.0
> 2. JBoss Drools Business Rules
> also,
> 1. Drools documentation and Manuals.
>
> But still there's no definitive guides for writing rules. The Drools
> Documentation has listed all the possible keywords. But, their Syntax and
> Semantics are missing.
> I went through this entire Mailing List hoping someone would have asked
> this question before me. But in vain.
>
> So, please refer/point me some good resources for Rules. Because in Drools,
> I believe, everything is possible only through Rules.
>
> Thanks and Regards,
>
> ___
> 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 Rule language resources Reg;

2010-08-10 Thread Murali Venugopal


  
  

Hi,
  
  I'm a newbie to Drools and Rules. I see this Mailing list provides
  lot of valuable information regarding Drools.
  Actually I'm looking for some good resources which helps in
  writing Rules. I.e Rule Syntax and Semantics. It's since 3 months
  I have started showing interest in Drools. But still I can't
  proceed more than the examples given in the books, which is not
  sufficient to work on real time projects.
  
  I'm referring books like
  1. Drools JBoss Rules 5.0
  2. JBoss Drools Business Rules
  also,
  1. Drools documentation and Manuals.
  
  But still there's no definitive guides for writing rules. The
  Drools Documentation has listed all the possible keywords. But,
  their Syntax and Semantics are missing.
  I went through this entire Mailing List hoping someone would have
  asked this question before me. But in vain. 
  
  So, please refer/point me some good resources for Rules. Because
  in Drools, I believe, everything is possible only through Rules.
  
  Thanks and Regards,
  
  

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


Re: [rules-users] drools in a SOA environment

2010-08-10 Thread Dieter D'haeyere
I read chapter 11 in Drools 5.0 developer's guide and that is indeed what is
described there (concerning the knowledgeagent).
Ok, step by step, I will understand (eventually ... ;)   )






2010/8/10 Swindells, Thomas 

>  Here’s how I understand it.
>
>
>
> Guvnor is one way to define rules, however it is an external system and you
> don’t have to use it (we don’t in our company). All guvnor basically does is
> provide a nice interface to define and generate the appropriate DRL and
> other source files.  If you want to run as a service then the easiest thing
> to do is to use a KnowledgeAgent to load the rules from wherever you have
> defined them (eg guvnor).
>
>
>
> Apache camel supports many ways to talk to it, one of which is SOAP (
> http://camel.apache.org/soap.html) this would probably work in exactly the
> same way as Rest as all they are is transport layers to carry the facts that
> you want to process and return.
>
>
>
> Thomas
>
>
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Dieter D'haeyere
> *Sent:* 10 August 2010 01:17
> *To:* Rules Users List
> *Subject:* [rules-users] drools in a SOA environment
>
>
>
> 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.
>
> --
>
>
> **
> This message is confidential and intended only for the addressee. If you
> have received this message in error, please immediately notify the
> postmas...@nds.com and delete it from your system as well as any copies.
> The content of e-mails as well as traffic data may be monitored by NDS for
> employment and security purposes. To protect the environment please do not
> print this e-mail unless necessary.
>
> NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18
> 4EX, United Kingdom. A company registered in England and Wales. Registered
> no. 3080780. VAT no. GB 603 8808 40-00
>
> **
>
> ___
> 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 in a SOA environment

2010-08-10 Thread Swindells, Thomas
Here's how I understand it.

Guvnor is one way to define rules, however it is an external system and you 
don't have to use it (we don't in our company). All guvnor basically does is 
provide a nice interface to define and generate the appropriate DRL and other 
source files.  If you want to run as a service then the easiest thing to do is 
to use a KnowledgeAgent to load the rules from wherever you have defined them 
(eg guvnor).

Apache camel supports many ways to talk to it, one of which is SOAP 
(http://camel.apache.org/soap.html) this would probably work in exactly the 
same way as Rest as all they are is transport layers to carry the facts that 
you want to process and return.

Thomas

From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Dieter D'haeyere
Sent: 10 August 2010 01:17
To: Rules Users List
Subject: [rules-users] drools in a SOA environment

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.



**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] npe in LogicalRetractCallback when using jpa persistence

2010-08-10 Thread Chris Raschl
Hi,
Just in case someone faces the same problem, comments inline:

Am 05.08.2010 13:53, schrieb Chris Raschl:
> I'm using the latest drools and drools flow snapshot with jpa persistence.
>
> When I'm retracting a fact from the knowledge session (which causes
> logical retraction), the session can't be persisted any more.
>
> During retraction a LogicalRetractCallback is instantiated using this
> constructor:
>
> public LogicalRetractCallback(final TruthMaintenanceSystem tms,
> final LogicalDependency node,
> final Set set,
> final InternalFactHandle handle,
> final PropagationContext context,
> final Activation activation) {
>   this.tms = tms;
>   this.node = node;
>   this.set = set;
>   this.handle = handle;
>   this.context = context;
> }
>
> As you can see an activation object can be passed (and actually is
> passed) to the constructor, but is never used. Retraction works though.
>
> The problem occurs when the knowledge session is persisted, because
> LogicalRetractCallback.write assumes that activation is not null, which
> leads to this npe:
>
> Caused by: java.lang.NullPointerException
> org.drools.common.TruthMaintenanceSystem$LogicalRetractCallback.write(TruthMaintenanceSystem.java:251)
> org.drools.marshalling.impl.OutputMarshaller.writeActionQueue(OutputMarshaller.java:201)

Adding this.activation = activation to the constructor does not help,
beause the npe in the write method remains. I tried it, then the whole 
expression "context.terminalTupleMap.get( this.activation.getTuple() )" 
in the write method evaluates to null...

I found out persistence was triggered by an unneccessary flush in my 
code. I removed that, everything works now.

That seems to be the case because the action queue is empty then and 
there's no need to persist it, thus the write method is never called. I 
guess the problem remains if someone tries to persist a session with an 
action queue containing a LogicalRetractCallback object.

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


[rules-users] [planner] curriculum course timetable modeling questions

2010-08-10 Thread Joshua Daniel
Hi,

I am a newbie and am currently in the process of evaluating the drools
solver module for generating a timetable. I have couple of questions in this
regard...

1. I have two curriculums (Grade 1 - A, Grade 1 - B) and would like to
allocate a single room for all courses under a curriculum. How do I specify
this constraint?
2. Currently the rules are specified for a single week (i.e. period / time
slot list). How do I specify this for an entire year, does it mean I have to
create additional period / time slot lists for the entire year.
3. There are 5 days and 3 periods per day (i.e. 15 sessions per week) and we
have 6 common subjects and a separate course (German, French) specific to
the curriculum, assuming we equally distribute the load (i.e. if I want all
the courses to be atleast twice a week and just the separate courses
(German, French) to be thrice a week, what should be the lesson size.

Env: I have installed drools-5.0-solver and verifying the above attached XML
via the curriculumcourse sample data.

-jd



Max Richard


Mary Jones


Samuel Jones


Helen Jessica


Sharon Tate


Joshua Davis


Bruce Niel


Simon Davis





q000


q001





English

3
5




40


German

3
5



60


Science

3
5




40


Arts and Crafts

2
5




40


Number Work

2
5




40


Multimedia

2
5




40


Games

2
5




40


French

3
5



40





1


2


3


4


5





1


2


3




































































Grade I - A
40


Grade I - B
40