Re: [rules-users] expert mailing list

2012-08-15 Thread Michael Anstis
Personally, I don't find the user list "high volume".

Perhaps re-categorizing the mailing lists we have works better:-

   - users: newbie type stuff


   - dev (rename drools-tech?): technical questions (not just
   implementation)

My 2c.

On 15 August 2012 00:33, Salaboy  wrote:

> Probably a linked in private group can do the job, I dont know if it
> supports all the features that you mention but at least you have the
> contacts network to checks who joins and post new topics. With a group of
> moderators the topics can be restricted easily
>
> Sent from my iPhone
>
> On 14 Aug 2012, at 22:48, Mark Proctor  wrote:
>
> > As the user list is now high volume, i'm contemplating an "invite only"
> expert list. I'm not sure who this would work, or if it's practical. But
> the idea is to have a lower volume list, with a higher quality of technical
> questions and discussions. This might make it easier for people to be
> engaged.
> >
> > I'm thinking of doing it as a google group "drools-expert-group" or
> something.
> >
> > I'm not entirely sure how to decide who gets an invite or not…. as it's
> very arbitrary. I guess in general anyone who gets a recommendation for
> someone on the list, gets an invite. But I'm open to other ideas to run
> this.
> >
> > Ideally we should be able to setup a number of moderators, that can
> handle this invite list, including people from the community. Although not
> sure if google groups supports this, need to find out.
> >
> > Anyway would like to here what people think, and would be interest to
> see alternative ways to do this. Maybe you can point to existing setups,
> that manage this sort of situation, that we can copy?
> >
> > Mark
> > ___
> > 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] expert mailing list

2012-08-15 Thread Wolfgang Laun
>From my point of view, the user list is becoming increasingly cluttered
with Qs regarding Guvnor, which doesn't interest me at all. A parallel list
guvnor-us...@lists.jboss.org might help.

-W


On 15 August 2012 10:12, Michael Anstis  wrote:

> Personally, I don't find the user list "high volume".
>
> Perhaps re-categorizing the mailing lists we have works better:-
>
>- users: newbie type stuff
>
>
>- dev (rename drools-tech?): technical questions (not just
>implementation)
>
> My 2c.
>
> On 15 August 2012 00:33, Salaboy  wrote:
>
>> Probably a linked in private group can do the job, I dont know if it
>> supports all the features that you mention but at least you have the
>> contacts network to checks who joins and post new topics. With a group of
>> moderators the topics can be restricted easily
>>
>> Sent from my iPhone
>>
>> On 14 Aug 2012, at 22:48, Mark Proctor  wrote:
>>
>> > As the user list is now high volume, i'm contemplating an "invite only"
>> expert list. I'm not sure who this would work, or if it's practical. But
>> the idea is to have a lower volume list, with a higher quality of technical
>> questions and discussions. This might make it easier for people to be
>> engaged.
>> >
>> > I'm thinking of doing it as a google group "drools-expert-group" or
>> something.
>> >
>> > I'm not entirely sure how to decide who gets an invite or not…. as it's
>> very arbitrary. I guess in general anyone who gets a recommendation for
>> someone on the list, gets an invite. But I'm open to other ideas to run
>> this.
>> >
>> > Ideally we should be able to setup a number of moderators, that can
>> handle this invite list, including people from the community. Although not
>> sure if google groups supports this, need to find out.
>> >
>> > Anyway would like to here what people think, and would be interest to
>> see alternative ways to do this. Maybe you can point to existing setups,
>> that manage this sort of situation, that we can copy?
>> >
>> > Mark
>> > ___
>> > 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] Guided Rule option not visible in Eclipse

2012-08-15 Thread Michael Anstis
Done (for next release).

On 14 August 2012 22:11, Mark Proctor  wrote:

>
> On 14 Aug 2012, at 19:29, dme1  wrote:
>
> > Thanks for the detailed response. With the 5.4 plugin I do not see the
> > "Guided Rule" option, just the "Rule Resource", so the screeshot seems
> to be
> > from an earlier version.
> >
> ok, thanks. we'll fix docs for next release.
>
> Mark
> > dme.
> >
> >
> >
> > --
> > View this message in context:
> http://drools.46999.n3.nabble.com/Guided-Rule-option-not-visible-in-Eclipse-tp4019119p4019126.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
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] expert mailing list

2012-08-15 Thread Josef Bajada
Agreed. I think a parallel list for all sub projects of Drools makes sense.
>From my side I am mostly interested in Planner so a
planner-us...@lists.jboss.org would also be good for me.


On 15 August 2012 10:18, Wolfgang Laun  wrote:

> >From my point of view, the user list is becoming increasingly cluttered
> with Qs regarding Guvnor, which doesn't interest me at all. A parallel list
> guvnor-us...@lists.jboss.org might help.
>
> -W
>
>
>
> On 15 August 2012 10:12, Michael Anstis  wrote:
>
>> Personally, I don't find the user list "high volume".
>>
>> Perhaps re-categorizing the mailing lists we have works better:-
>>
>>- users: newbie type stuff
>>
>>
>>- dev (rename drools-tech?): technical questions (not just
>>implementation)
>>
>> My 2c.
>>
>> On 15 August 2012 00:33, Salaboy  wrote:
>>
>>> Probably a linked in private group can do the job, I dont know if it
>>> supports all the features that you mention but at least you have the
>>> contacts network to checks who joins and post new topics. With a group of
>>> moderators the topics can be restricted easily
>>>
>>> Sent from my iPhone
>>>
>>> On 14 Aug 2012, at 22:48, Mark Proctor  wrote:
>>>
>>> > As the user list is now high volume, i'm contemplating an "invite
>>> only" expert list. I'm not sure who this would work, or if it's practical.
>>> But the idea is to have a lower volume list, with a higher quality of
>>> technical questions and discussions. This might make it easier for people
>>> to be engaged.
>>> >
>>> > I'm thinking of doing it as a google group "drools-expert-group" or
>>> something.
>>> >
>>> > I'm not entirely sure how to decide who gets an invite or not…. as
>>> it's very arbitrary. I guess in general anyone who gets a recommendation
>>> for someone on the list, gets an invite. But I'm open to other ideas to run
>>> this.
>>> >
>>> > Ideally we should be able to setup a number of moderators, that can
>>> handle this invite list, including people from the community. Although not
>>> sure if google groups supports this, need to find out.
>>> >
>>> > Anyway would like to here what people think, and would be interest to
>>> see alternative ways to do this. Maybe you can point to existing setups,
>>> that manage this sort of situation, that we can copy?
>>> >
>>> > Mark
>>> > ___
>>> > 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] Creating template column in guvnor for attribute value?

2012-08-15 Thread Michael Anstis
Hi,

This is somewhere between a bug and an enhancement:

Currently the Template Editor does not support template keys for Metadata
or Attributes; i.e. your requirement is an enhancement.

You can however provide literal values formatted as template keys (e.g.
@{xx} as you have discovered); i.e. there is a bug.

The enhancement has already been reported here:
https://issues.jboss.org/browse/GUVNOR-1907

Please note, with 5.4 you can use a web-guided Decision Table.

These support BRL fragments for columns (i.e. you can define a column that
uses any feature in the BRL\Guided Rule Editor or Template Editor) and they
already support interpolation of values for both Meta-data and Attributes.

With kind regards,

Mike

On 13 August 2012 18:38, dunnlow  wrote:

> I'm using Guvnor 5.4
>
> I find myself sometimes wanting to use templates to map a string to a
> metadata value or timer.  For example, based upon a name, set a value for
> the timeout.  As far as I can tell however, the only way to create a
> template column in guvnor is to include the column identifier in the LHS.
>
> For example, I have a basic rule template that checks a name (there is only
> a "name" column in the template matrix).  Then, I click on options, add a
> timer and give it a value of "@{timeout}" I get an error - the timeout
> column does not exist in the template.  However, if I write a dummy
> expression on the LHS like "foo" not matches timeout, the timeout column is
> created and everything is great once I set the value.  If I delete the
> predicate that uses timeout, I get an error again for the timer attribute.
>
> This gets really ugly because I end up having (seemingly) useless
> predicates.  Is there a clean way to support this functionality?
>
> Thanks,
> -J
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Creating-template-column-in-guvnor-for-attribute-value-tp4019108.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] Does Drools expert accepts XML files?

2012-08-15 Thread Sadiroveski
Dear,

Any answer for the above question?

Best Regards,



--
View this message in context: 
http://drools.46999.n3.nabble.com/Does-Drools-expert-accepts-XML-files-tp4019033p4019140.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] Getting Null pointer exception for applying change set

2012-08-15 Thread Rana
ok I have used "Classpath:" but now it is saying this.

The file is there in the specified location.



java.lang.RuntimeException: Unable to get LastModified for ClasspathResource
at
org.drools.io.impl.ClassPathResource.getLastModified(ClassPathResource.java:179)
at
org.drools.io.impl.ClassPathResource.getInputStream(ClassPathResource.java:140)
at org.drools.compiler.DrlParser.parse(DrlParser.java:145)
at org.drools.compiler.DrlParser.parse(DrlParser.java:139)
at
org.drools.compiler.PackageBuilder.drlToPackageDescr(PackageBuilder.java:478)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:467)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:673)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:729)
at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:955)
at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:675)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:203)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:182)
at
com.drfirst.pi.affiliate.drools.DroolsKnowledgeObject.getKnowledgeBase(DroolsKnowledgeObject.java:61)
at
com.drfirst.pi.affiliate.drools.DroolsKnowledgeObject.getKnowledgeSession(DroolsKnowledgeObject.java:75)
at com.drfirst.pi.affiliate.drools.FireRules.(FireRules.java:27)
at
com.drfirst.pi.affiliate.drools.test.DroolsRuleTest.test(DroolsRuleTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.io.FileNotFoundException:
'/src/main/rules/sample-md/AndroGel.drl' cannot be opened because it does
not exist
at 
org.drools.io.impl.ClassPathResource.getURL(ClassPathResource.java:164)
at
org.drools.io.impl.ClassPathResource.getLastModified(ClassPathResource.java:175)
... 36 more


Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Getting-Null-pointer-exception-for-applying-change-set-tp4019117p4019142.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] Does Drools expert accepts XML files?

2012-08-15 Thread Wolfgang Laun
The Drools XML format for rules is deprecated, not in sync with the current
level of the DRL language, and not maintained in any way.

-W


On 15/08/2012, Sadiroveski  wrote:
> Dear,
>
> Any answer for the above question?
>
> Best Regards,
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Does-Drools-expert-accepts-XML-files-tp4019033p4019140.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] Does Drools expert accepts XML files?

2012-08-15 Thread Stephen Masters
And if you're looking to insert facts in XML format, I don't think that it's 
supported natively. (Someone please correct me if I'm wrong!)

However, assuming you have a schema for your XML then it's pretty easy to use 
JAXB (or similar) to generate Java classes for marshalling, which can be 
inserted as facts.

Steve


On 15 Aug 2012, at 16:14, Wolfgang Laun wrote:

> The Drools XML format for rules is deprecated, not in sync with the current
> level of the DRL language, and not maintained in any way.
> 
> -W
> 
> 
> On 15/08/2012, Sadiroveski  wrote:
>> Dear,
>> 
>> Any answer for the above question?
>> 
>> Best Regards,
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/Does-Drools-expert-accepts-XML-files-tp4019033p4019140.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

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


[rules-users] fireUntilHalt() is halt forever

2012-08-15 Thread Rana
Hi my rule file is halt for ever. Can anybody tell me why. I debugged and saw
that it is going into this method in DefaultAgenda.class

public void fireUntilHalt(final AgendaFilter agendaFilter) {

synchronized ( this.halt ) {
if( !this.halt.get() ) this.halt.wait();   //it is
halt here  and waiting.
}


this is my rule file.

http://drools.46999.n3.nabble.com/file/n4019146/rule_file.txt rule_file.txt 


Please help me out.

Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146.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] fireUntilHalt() is halt forever

2012-08-15 Thread Mauricio Salatino
Hi,
yes if you use : drools.halt();
that will stop the session.
What exactly do you want to achieve with that?
Cheers

On Wed, Aug 15, 2012 at 5:49 PM, Rana  wrote:

> Hi my rule file is halt for ever. Can anybody tell me why. I debugged and
> saw
> that it is going into this method in DefaultAgenda.class
>
> public void fireUntilHalt(final AgendaFilter agendaFilter) {
>
> synchronized ( this.halt ) {
> if( !this.halt.get() ) this.halt.wait();   //it is
> halt here  and waiting.
> }
>
>
> this is my rule file.
>
> http://drools.46999.n3.nabble.com/file/n4019146/rule_file.txtrule_file.txt
>
>
> Please help me out.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146.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
>



-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - 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] fireUntilHalt() is halt forever

2012-08-15 Thread Rana
Thanks for your reply.

Once all the rules of that file is good, then it should retrieve the
resources in the rule file but not the session. and then may be fire other
rule file.

Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146p4019148.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 to check if a property IS null ?

2012-08-15 Thread Hendy Irawan
Thank you.

Here's a very simple use case : https://github.com/ceefour/droolsnull

Running this on Drools 5.4.0 will output:

00:29:34.122 [main] INFO  c.h.droolsnull.BookingService - getNullQty()
called!
00:29:34.125 [main] INFO  c.h.droolsnull.BookingService - getFilledQty()
called!
00:29:34.139 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - Notify has
filled sentTime: Thu Aug 16 00:29:34 WIT 2012
00:29:34.139 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - Notify has
NULL sentTime
00:29:34.140 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - You've got a
filled booking with qty 5.0
00:29:34.140 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - You've got a
NULL booking
00:29:34.140 [main] INFO  c.hendyirawan.droolsnull.DroolsNull -
BookingService can return filled qty: 10.0

Expected is one more:

BookingService can return NULL qty

BookingService.getNullQty() is called by the Drools rule but then ignored.
How to capture this?

The rules :

package com.hendyirawan.droolsnull
dialect "mvel"

import org.slf4j.*;

import com.hendyirawan.droolsnull.*;

global Logger log;
global BookingService bookingService;

rule "Booking data with not null qty exists"
when
$booking  : Booking( $qty : qty != null )
then
log.info("You've got a filled booking with qty {}", {$qty});
end

rule "Booking data with null qty exists" 
when
$booking  : Booking( qty == null )
then
log.info("You've got a NULL booking");
end

rule "BookingService can return null qty" 
when
Double( this == null ) from bookingService.getNullQty()
then
log.info("BookingService can return NULL qty");
end

rule "BookingService can return filled qty" 
when
$qty  : Double() from bookingService.getFilledQty()
then
log.info("BookingService can return filled qty: {}", {$qty});
end

rule "Notify has null sentTime" 
when
$notify : Notify( sentTime == null )
then
log.info("Notify has NULL sentTime");
end

rule "Notify has filled sentTime" 
when
$notify : Notify( $sentTime : sentTime != null )
then
log.info("Notify has filled sentTime: {}", {$sentTime});
end

The rule that isn't working :

rule "BookingService can return null qty" 
when
Double( this == null ) from bookingService.getNullQty()
then
log.info("BookingService can return NULL qty");
end

Thank you.

Hendy


(I also once had a criteria like " $notify  : Notify( sentTime == 
null ) "
not working but can't reproduce it again yet. if I can find it I'll post
again)



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-check-if-a-property-IS-null-tp4019014p4019150.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] fireUntilHalt() is halt forever

2012-08-15 Thread Wolfgang Laun
I guess you call kSession.fireUntilHalt().  This call should return
after drools.halt() is called from one of the rules. Java code
following this call should do whatever needs to be done. (I don't know
what you mean by "retrieve the resources...".)

-W



On 15/08/2012, Rana  wrote:
> Thanks for your reply.
>
> Once all the rules of that file is good, then it should retrieve the
> resources in the rule file but not the session. and then may be fire other
> rule file.
>
> Thanks.
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146p4019148.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] How to check if a property IS null ?

2012-08-15 Thread Wolfgang Laun
Using a Java condition like "this == null" is a slip of the keyboard.
-W



On 15/08/2012, Hendy Irawan  wrote:
> Thank you.
>
> Here's a very simple use case : https://github.com/ceefour/droolsnull
>
> Running this on Drools 5.4.0 will output:
>
> 00:29:34.122 [main] INFO  c.h.droolsnull.BookingService - getNullQty()
> called!
> 00:29:34.125 [main] INFO  c.h.droolsnull.BookingService - getFilledQty()
> called!
> 00:29:34.139 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - Notify has
> filled sentTime: Thu Aug 16 00:29:34 WIT 2012
> 00:29:34.139 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - Notify has
> NULL sentTime
> 00:29:34.140 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - You've got
> a
> filled booking with qty 5.0
> 00:29:34.140 [main] INFO  c.hendyirawan.droolsnull.DroolsNull - You've got
> a
> NULL booking
> 00:29:34.140 [main] INFO  c.hendyirawan.droolsnull.DroolsNull -
> BookingService can return filled qty: 10.0
>
> Expected is one more:
>
> BookingService can return NULL qty
>
> BookingService.getNullQty() is called by the Drools rule but then ignored.
> How to capture this?
>
> The rules :
>
> package com.hendyirawan.droolsnull
> dialect "mvel"
>
> import org.slf4j.*;
>
> import com.hendyirawan.droolsnull.*;
>
> global Logger log;
> global BookingService bookingService;
>
> rule "Booking data with not null qty exists"
>   when
>   $booking  : Booking( $qty : qty != null )
>   then
>   log.info("You've got a filled booking with qty {}", {$qty});
> end
>
> rule "Booking data with null qty exists"
>   when
>   $booking  : Booking( qty == null )
>   then
>   log.info("You've got a NULL booking");
> end
>
> rule "BookingService can return null qty"
>   when
>   Double( this == null ) from bookingService.getNullQty()
>   then
>   log.info("BookingService can return NULL qty");
> end
>
> rule "BookingService can return filled qty"
>   when
>   $qty  : Double() from bookingService.getFilledQty()
>   then
>   log.info("BookingService can return filled qty: {}", {$qty});
> end
>
> rule "Notify has null sentTime"
>   when
>   $notify : Notify( sentTime == null )
>   then
>   log.info("Notify has NULL sentTime");
> end
>
> rule "Notify has filled sentTime"
>   when
>   $notify : Notify( $sentTime : sentTime != null )
>   then
>   log.info("Notify has filled sentTime: {}", {$sentTime});
> end
>
> The rule that isn't working :
>
> rule "BookingService can return null qty"
>   when
>   Double( this == null ) from bookingService.getNullQty()
>   then
>   log.info("BookingService can return NULL qty");
> end
>
> Thank you.
>
> Hendy
>
>
> (I also once had a criteria like " $notify: Notify( sentTime == 
> null ) "
> not working but can't reproduce it again yet. if I can find it I'll post
> again)
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-check-if-a-property-IS-null-tp4019014p4019150.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] fireUntilHalt() is halt forever

2012-08-15 Thread Rana
Nope it is not working like that.

I removed it. Using fireAll

Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/fireUntilHalt-is-halt-forever-tp4019146p4019153.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] modifying the problem facts while running the solver - Drools Planner

2012-08-15 Thread Garf

spinjala wrote
> 
> 1) When a solution violates all constraints, does it provide a default
> solution? If so, can it be changed so that it doesn't provide one?
> Otherwise, is there a way to assure that no solution is generated when ALL
> constraints are violated. 
> 

Let's walk through the code. 
Solver.solve() will look for solutions until any of the conditions specified
by the termination configuration are met. These could be based on time, or
score, etc.

In your case, your best solution will have a negative hard score. You would
find this via:

Solution Sol = solver.getBestSolution();
if (Sol.getScore().getHardScore() == 0) {
  // no constraints are violated
} else {
  // Sol = null
}


spinjala wrote
> 
> 2) When a feasible solution is not generated, is it possible to make a
> custom solution as the most relevant solution instead of the generated
> one? For ex. if the solution generated by Drools planner assigned a work
> order WO2 to a resource R1, is it possible to create a custom solution
> that assigns it to, possibly R2?
> 

Sharpen your grammar here.
Your first sentence's first clause says that the feasible solution is not
generated, but the last clause references "the generated one."

So who (or what) is making this custom solution?
Remember that the Solution is your class. You are free to write your own
code to fill it on your own via your own code (or user actions).

Jon



--
View this message in context: 
http://drools.46999.n3.nabble.com/modifying-the-problem-facts-while-running-the-solver-Drools-Planner-tp4019099p4019154.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 to check if a property IS null ?

2012-08-15 Thread Hendy Irawan
Thank you.

"this == null" is weird indeed in Java, but I honestly don't know how to
express this expression in Drools DSL.

A more realistic rule would be:

when 
$product : Product( )
Double( this == null ) from bookingService.getQty( $product ) 

So what I want to do is detect when a method call returns null. The method
call can contain parameters but it can be a simple method like before.

How to do this?

Thank you.

Hendy



--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-check-if-a-property-IS-null-tp4019014p4019155.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 to check if a property IS null ?

2012-08-15 Thread Michael Anstis
Hi,

I assume you mean Drools DRL (DSL is something different and none of your
examples suggest use of this so far).

How about checking for the absence of the Double instead of it being null:-

when
$product : Product( )
not Double( ) from bookingService.getQty( $product )

I've not tried it personally.

With kind regards,

Mike

On 15 August 2012 19:54, Hendy Irawan  wrote:

> Thank you.
>
> "this == null" is weird indeed in Java, but I honestly don't know how to
> express this expression in Drools DSL.
>
> A more realistic rule would be:
>
> when
> $product : Product( )
> Double( this == null ) from bookingService.getQty( $product )
>
> So what I want to do is detect when a method call returns null. The method
> call can contain parameters but it can be a simple method like before.
>
> How to do this?
>
> Thank you.
>
> Hendy
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/How-to-check-if-a-property-IS-null-tp4019014p4019155.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] How to check if a property IS null ?

2012-08-15 Thread Hendy Irawan
Thank you Mike for the correction, yes I meant the DRL.

And your suggestion works! Thank you!

I'll update my toy project at https://github.com/ceefour/droolsnull :)

Thanks a lot!

Hendy

On Thu, Aug 16, 2012 at 2:04 AM, manstis [via Drools] <
ml-node+s46999n4019156...@n3.nabble.com> wrote:

> Hi,
>
> I assume you mean Drools DRL (DSL is something different and none of your
> examples suggest use of this so far).
>
> How about checking for the absence of the Double instead of it being null:-
>
> when
> $product : Product( )
> not Double( ) from bookingService.getQty( $product )
>
> I've not tried it personally.
>
> With kind regards,
>
> Mike
>
> --
Hendy Irawan - on Twitter  - on
LinkedIn
Web Developer | Bippo Indonesia  | Akselerator
Bisnis | Bandung




--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-check-if-a-property-IS-null-tp4019014p4019157.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] modify and update is not working in the rule file

2012-08-15 Thread Rana
Please let me know what is the problem in this. It does not update the values
when I get the values, it gives me null in my unit test method.


rule "Drug Strength" extends "Provider State"
no-loop true
dialect "mvel"
agenda-group "AndroGel"
when
Drug( $drug.getStrength == "20.25 mg/1.25 gram (1.62 %)" )
$p : Program()
then
#drools.getWorkingMemory().setGlobal("boolDrugStrength", true )
modify( $p) {
setProgramId( "610.conten...@samplemd.com" ),
setProgramName( "AndroGel 1.62% Savings Card" )
};
update( $p )
#retract( $p )
#retract( $drug )
log.info("Prgram ID and Program Name is set for program Coupon 
for
Androgel");
#drools.halt();
end


Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/modify-and-update-is-not-working-in-the-rule-file-tp4019158.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] Rule flows in Drools planner configuration?

2012-08-15 Thread Garf

spinjala wrote
> 
> Is it possible to have a rule flow file that defines a set of rules
> (constraints) but executed in the order per the defined ruleflow.? I dont
> see any example doing that so I was wondering if it is possible at all to
> have the constraints defined with a rule flow file instead of single .drl
> file?
> 

I guess that the challenge here is that a rule flow file awaits
startProcess() to be fired.
Planner's DroolsScoreDirector.calculateScore() only calls fireAllRules().

Jon



--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-flows-in-Drools-planner-configuration-tp4019143p4019160.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] modifying the problem facts while running the solver - Drools Planner

2012-08-15 Thread Garf

spinjala wrote
> 
> I tried setting the scoreAttained and maximum time allowed to spend in my
> termination configuration, but none seems to stop the solver finding the
> solution that violates ALL constraints  and hence throws a negative hard
> score. Is this the only way to do it or any other way is available to
> force the solver not to look for a solution when ALL constraints are
> violated?
> 

>From Planner's perspective, there are multiple possible solutions.
Each solution has a score, a combination of the hard and soft scores, each
of which represents the sum of constraint violations.
If the scores are <0, then the solution is nonoptimal; and thus, it will
keep looking.

You might try the termination/maximumUnimprovedStepCount config setting.
(see section 6.6.4 of the doc)

This stops the solving after a number of steps have been tried without any
improvement to the score.

Jon




--
View this message in context: 
http://drools.46999.n3.nabble.com/modifying-the-problem-facts-while-running-the-solver-Drools-Planner-tp4019099p4019161.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] in Excel Decision Table

2012-08-15 Thread dme1
Hi,

How do I use  in Decision Tables created using Eclipse (Excel
Spreadsheets). I have created a rule where I have provided "" as
a criteria but its been taken as the value of the parameter instead of
creating a separate rule with the "not" clause. I am providing the
screenshot of the decision table as well as the rules generated by Drools.

I would much appreciate if someone can advise on how I can use 
in my rules.

http://drools.46999.n3.nabble.com/file/n4019162/droolsdt.jpg 

Drools conversion to ".drl" below (Rule Flight_Type_Rules_15 shows
 being used as parameter valUE):

DRL is :: package com.test.BasicDTRules;
//generated from Decision Table
import java.util.Date;
import com.test.Flight;
// rule values at C11, header at C6
rule "Flight Type Rules_11"
when
flight : Flight(flightNumber >= "0001", flightNumber <= "1000",
airlineCode == "BA")
then
flight.setFlightType("SH");
flight.setValid(true);
System.out.println("Row 1");
end

// rule values at C12, header at C6
rule "Flight Type Rules_12"
when
flight : Flight(flightNumber >= "0001", flightNumber <= "1000",
airlineCode == "AA")
then
flight.setFlightType("SH");
flight.setValid(true);
System.out.println("Row 2");
end

// rule values at C13, header at C6
rule "Flight Type Rules_13"
when
flight : Flight(flightNumber >= "1001", flightNumber <= "2500",
airlineCode == "VG")
then
flight.setFlightType("LH");
flight.setValid(true);
System.out.println("Row 3");
end

// rule values at C14, header at C6
rule "Flight Type Rules_14"
when
flight : Flight(flightNumber >= "1001", flightNumber <= "2500",
airlineCode == "AA")
then
flight.setFlightType("550");
flight.setValid(true);
System.out.println("Row 4");
end

// rule values at C15, header at C6
rule "Flight Type Rules_15"
when
flight : Flight(flightNumber >= "2501", flightNumber <= "",
airlineCode == "")
then
flight.setFlightType("Invalid");
flight.setValid(false);
System.out.println("Row 5");
end


Thanks,
dme



--
View this message in context: 
http://drools.46999.n3.nabble.com/otherwise-in-Excel-Decision-Table-tp4019162.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] Any additional (better) documentation for the examples included in Drools Planner product?

2012-08-15 Thread Garf

spinjala wrote
> 
> We have been having real hard time understanding the examples with such
> limited/no documentation about the examples that are included in the
> product. Did someone find any other documentation on them apart from the
> 5-6 paragraphs mentioned in the reference manual? Also, we found the
> reference manual not detailed/ easy enough for us to delve into the
> product to understand its features better. The biggest question is , Is
> this product production ready and supported by Redhat yet?
> 

Did you see the reference manual here:
http://www.jboss.org/drools/documentation

Which are the 5-6 paragraphs you are referring to?

I'll concede that there could be shorter summaries of the manual for getting
started.

Jon



--
View this message in context: 
http://drools.46999.n3.nabble.com/Any-additional-better-documentation-for-the-examples-included-in-Drools-Planner-product-tp4019149p4019163.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] Anyway to get Failed Reason for Failed Rule?

2012-08-15 Thread Rana
How can I add the rules to Verifier. I could not get a examples.

Thanks.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Anyway-to-get-Failed-Reason-for-Failed-Rule-tp4019070p4019164.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] in Excel Decision Table

2012-08-15 Thread Michael Anstis
The use of "Otherwise" is not supported in XLS at the moment.

There is an open JIRA to address this:
https://issues.jboss.org/browse/GUVNOR-1278

With kind regards,

Mike

On 15 August 2012 21:16, dme1  wrote:

> Hi,
>
> How do I use  in Decision Tables created using Eclipse (Excel
> Spreadsheets). I have created a rule where I have provided "" as
> a criteria but its been taken as the value of the parameter instead of
> creating a separate rule with the "not" clause. I am providing the
> screenshot of the decision table as well as the rules generated by Drools.
>
> I would much appreciate if someone can advise on how I can use 
> in my rules.
>
> http://drools.46999.n3.nabble.com/file/n4019162/droolsdt.jpg
>
> Drools conversion to ".drl" below (Rule Flight_Type_Rules_15 shows
>  being used as parameter valUE):
>
> DRL is :: package com.test.BasicDTRules;
> //generated from Decision Table
> import java.util.Date;
> import com.test.Flight;
> // rule values at C11, header at C6
> rule "Flight Type Rules_11"
> when
> flight : Flight(flightNumber >= "0001", flightNumber <=
> "1000",
> airlineCode == "BA")
> then
> flight.setFlightType("SH");
> flight.setValid(true);
> System.out.println("Row 1");
> end
>
> // rule values at C12, header at C6
> rule "Flight Type Rules_12"
> when
> flight : Flight(flightNumber >= "0001", flightNumber <=
> "1000",
> airlineCode == "AA")
> then
> flight.setFlightType("SH");
> flight.setValid(true);
> System.out.println("Row 2");
> end
>
> // rule values at C13, header at C6
> rule "Flight Type Rules_13"
> when
> flight : Flight(flightNumber >= "1001", flightNumber <=
> "2500",
> airlineCode == "VG")
> then
> flight.setFlightType("LH");
> flight.setValid(true);
> System.out.println("Row 3");
> end
>
> // rule values at C14, header at C6
> rule "Flight Type Rules_14"
> when
> flight : Flight(flightNumber >= "1001", flightNumber <=
> "2500",
> airlineCode == "AA")
> then
> flight.setFlightType("550");
> flight.setValid(true);
> System.out.println("Row 4");
> end
>
> // rule values at C15, header at C6
> rule "Flight Type Rules_15"
> when
> flight : Flight(flightNumber >= "2501", flightNumber <=
> "",
> airlineCode == "")
> then
> flight.setFlightType("Invalid");
> flight.setValid(false);
> System.out.println("Row 5");
> end
>
>
> Thanks,
> dme
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/otherwise-in-Excel-Decision-Table-tp4019162.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


[rules-users] Decision Table Management Process

2012-08-15 Thread dme1
Hi,

I am looking for the best approach to manage decision tables within Drools,
essentially the hand-off process between developers and Business Analysts.

There are 2 ways to create and maintain Decision Tables in Drools

1. Use the XLS based decision tables. This requires developers to create the
initial XLS file with sample data, and work with the BAs to fill in the
actual requirements. On an ongoing basis if BAs require to maintain rules in
XLS based decision tables, they have to download the the existing XLS file,
update the rules using Excel - prettify as required for grouping etc.,
upload back to Guvnor and then test the rules.

2. Use the Guided Decision Table feature. This feature is available only in
Guvnor, and any tables created in Guvnor cannot be opened and maintained in
Eclipse (atleast not easily as at this time you are essentially looking at
updating XML files). So developers have to create/update rules in Guvnor as
well as BAs use the same tools to update/maintain rules in Guvnor. 

Are there any other/better options available to create/manage decision
tables and co-ordinate the efforts between development (who prefer to use
Eclipse based tooling) and BAs (who would benefit from the richer features
available in Guvnor).

Thanks,
dme



--
View this message in context: 
http://drools.46999.n3.nabble.com/Decision-Table-Management-Process-tp4019167.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] Hiding a column in web guided decision table disables a condition or action

2012-08-15 Thread jasonxzhong
Hi,

I am trying to develop a guide decision table so that each row will
transform to the following rule

rule "..."
when
  data : RuleData(
 controlCode == 123, 
 term = ""
 )
then 
  TermTicket t = new TimeTicket();
  t.setTerm(data.getTerm());
  t.setSomerValue(...)
  insert(t);
end

The condition that tests RuleData.controlCode attribute does not use any
value from the table itself but just a constant "123" so I added a BRL
fragment "controlCode equals to 123". This seems to work as long as this
column is not hidden and the checkbox in the corresponding column is checked
(by default the box is not checked therefore the condition is not added to
the rule). Since the condition does not require any user provided value it
is rather odd that it needs to be displayed in the table and requires user
to check the box to enable it. Is there a way to get around this or this is
a limitation of the guided decision table?

Similarly in the same rule I want to set the value of TermTicket.term to a
value taken from the RuleData, not from the table itself. Again I can get
this to work by using a free form DRL. However this also requires the column
itself to be shown in the table and the user needs to check the checkbox in
that column to enable this action. 

Any suggestions?

Thanks, Jason








--
View this message in context: 
http://drools.46999.n3.nabble.com/Hiding-a-column-in-web-guided-decision-table-disables-a-condition-or-action-tp4019169.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] Handling maps in Drools

2012-08-15 Thread Manav
Hi,

I am facing an issue with handling maps in LHS of drools. Appreciate your help 
with the same. 

I am using Drools version 5.1.


I have two maps where one is a reference map that contains certifications (key) 
and scores(value) required and other is map of user's actual certifications and 
scores. Objective is to find the certifications from users map based on keys in 
the reference map . Then for these certifications sum the score values and 
check if they cross the threshold. 

While trying to do the first step i am facing an issue . My rule looks like 
this :- 

rule "Map test"
when
    $rb : Certifications($reqCertificationKeys : requiredCertifications.keySet)
    $user : User($userCertifications : userCertifications)
    $arg : String() from $reqCertificationKeys    
    HashMap ($value : this[$arg] != null) from $userCertifications // Does not 
work 
then
    System.out.println ("Hash Map" + $arg);
end

However if i change the above line that has issues with below 

    HashMap ($value : this["Java"] != null) from $userCertifications // Works 

Is there a way to replace the key with a variable than with a fixed value ? Is 
it possible to iterate the second map with the key values that we get from the 
reference map ? 

Regards,
Manav

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