Re: [rules-users] not operation available in drools

2012-06-13 Thread Davide Sottara
Are the two conditions constraints inside the same pattern or two different
patterns?
In the former case, DeMorgan's laws also apply:

( a != "x") || ( b != "y" )

and you should anyway be able to use free-form boolean expressions inside a
pattern,
provided that you use one of the latest versions.

Otherwise (two patterns), see the previous posts.

Best,
Davide

--
View this message in context: 
http://drools.46999.n3.nabble.com/not-operation-available-in-drools-tp4017936p4017939.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] not operation available in drools

2012-06-13 Thread pratibhapandey
Hello,

you can use not like this

Rule a 

When 

not( (aaa == “bbb”) && (bbb == “aaa”) ) 

Then 

// do smth 

End 



--
View this message in context: 
http://drools.46999.n3.nabble.com/not-operation-available-in-drools-tp4017936p4017938.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] not operation available in drools

2012-06-13 Thread Wolfgang Laun
Read about the "Conditional Element not" in the Drools Expert manual.
You'll also need to learn about the "Conditional Element or".
-W

On 14/06/2012, learner  wrote:
> I have a scenario like below
>
> Rule a
>
> When
>
> ! (
>
> (aaa == “bbb”) &&
>
> (bbb == “aaa”)
>
> )
>
> Then
>
> // do smth
>
> End
>
> I’m looking for an operator to reverse the evaluation result of the
> expression in the brackets. Is this possible
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/not-operation-available-in-drools-tp4017936.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] not operation available in drools

2012-06-13 Thread learner
I have a scenario like below 

Rule a 

When 

! ( 

(aaa == “bbb”) && 

(bbb == “aaa”) 

) 

Then 

// do smth 

End 

I’m looking for an operator to reverse the evaluation result of the
expression in the brackets. Is this possible

--
View this message in context: 
http://drools.46999.n3.nabble.com/not-operation-available-in-drools-tp4017936.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 read DRL files not in resource classpath?

2012-06-13 Thread Charles
Thanks for introducing ResourceFactory.  It simplified the code further.  
Can I know what is KnowledgeBuilder ?  

// Import
import org.drools.io.Resource;
import org.drools.io.ResourceFactory;

// Implementation
Resource resource = ResourceFactory.newFileResource( "./rules.drl" );
RuleBase ruleBase = ruleBaseLoader.loadFromReader( resource.getReader() ); 
scoreDirectorFactoryConfig.setRuleBase(ruleBase);

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-read-DRL-files-not-in-resource-classpath-tp4017885p4017935.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 read DRL files not in resource classpath?

2012-06-13 Thread Charles
Thanks Geoffrey. 
That really solved my problem.

Below is how I used scoreDirectorFactoryConfigy.setRuleBase( ruleBase ). 
Note: 
/rules.drl must be removed from solverConfig.xml or
else will have problem.

// Imports
import org.drools.compiler.RuleBaseLoader;
import org.drools.RuleBase;

// Implementation
String DRLPath = "./rules.drl";
FileReader fileReader = new FileReader( new File( *DRLPath* ) );
RuleBaseLoader ruleBaseLoader = RuleBaseLoader.getInstance();
RuleBase ruleBase = ruleBaseLoader.loadFromReader( fileReader );
scoreDirectorFactoryConfig.setRuleBase(ruleBase);
fileReader.close();

Solver solver = solverFactory.buildSolver();

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-read-DRL-files-not-in-resource-classpath-tp4017885p4017934.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] (no subject)

2012-06-13 Thread David Wynter
http://root256.com/wordpress/wp-content/themes/default/googlemail.html___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Unable to upload POJO model jar to Guvnor 5.3.1 on Glassfish 3.1.2

2012-06-13 Thread Garf
On June 1st, claz12 wrote: "when I try to upload the model jar file, I get
the error 'Unable to to upload the file' message box displayed."

I was able to reproduce this problem on Guvnor 5.4 / Tomcat 7 -- and
uploading a JDK1.7 compiled Jar. 
The HTTP response suggested that the Java version was wrong. 
I produced 1.6 java, and it was able to upload successfully.

I suppose it probably would be best to show the precise error message to the
user.

Jon

--
View this message in context: 
http://drools.46999.n3.nabble.com/Unable-to-upload-POJO-model-jar-to-Guvnor-5-3-1-on-Glassfish-3-1-2-tp4017722p4017931.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] 5.4.0 Final and issue: GUVNOR-1873

2012-06-13 Thread TonyN
Another JIRA ticket for the javax.jcr.InvalidStateException  issue. 
(GUVNOR-1912).

thx,
tony


--
View this message in context: 
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880p4017930.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] 5.4.0 Final and issue: GUVNOR-1873

2012-06-13 Thread TonyN
I just opened a JIRA ticket (GUVNOR-1911) but has no way to assign to you (but 
I have requested to be assigned to you, Mike)



From: manstis [via Drools] [mailto:ml-node+s46999n4017925...@n3.nabble.com]
Sent: Wednesday, June 13, 2012 1:35 PM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

That looks like a nabble error, AFAIK it's definately nothing to do with JIRA.

You should be able to simply go to https://issues.jboss.org/browse/GUVNOR 
(login with a JBoss Community login, creating an account if need be) and create 
a new issue.

If raising one for the javax.jcr.InvalidStateException as well please ensure 
you include all steps to reproduce the error.

Thanks,

Mike

On 13 June 2012 20:44, TonyN <[hidden 
email]> wrote:
Hi Mike,
I am trying to raise an JRA issue (per your email below) but running into NAML 
issue

Error:
Oops... An error has occurred
Please contact Nabble Support and explain what you 
did to cause this error. Your feedback is very important to us.
 Go to NAML Editor
More Details
Error 500

macroName is null

Message: macroName is null

RequestURI: /template/NamlServlet.jtp

Server: n3.nabble.com

Caused by:

From: manstis [via Drools] [mailto:[hidden 
email]]
Sent: Wednesday, June 13, 2012 8:49 AM

To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

Looks like a different bug to the one I fixed :(

My fix related to when a POJO model is uploaded and the imports automatically 
generated. The drop-down you have identified still needs fixing.

The "Advanced view" is the work-around at present (but you should find the 
imports are all present and correct after uploading a POJO JAR).

Would you be so kind as to raise another JIRA (and assign to me)?

Thanks,

Mike

On 13 June 2012 16:32, TonyN <[hidden 
email]> wrote:
Mike,

thanks for taking the time to look into this.  This is my observation:

1) Copy Test_R02 from package 'Test_Package' to package 't1'
2) Copy Function 'compare_revs' from package 'Test_Package' to package 't1'
3) Build Package
4) Got a 'Success' result.
5) Notice that the following classes appeared in the 'Configuration: Import 
Types'  text area widget
a) 'com.boeing.irip.model.TcItem.Dataset'
b) 'com.boeing.irip.model.TcItem.Dataset.NamedReference'
   Note:  notice the '.' (dot) convention.  (Did you import them in this way)?

To show the failure:
1) Remove the above 2 classes from 'Configuration: Import Types'  text area 
widget.
2) Re-Import them back in as-is (click on the + sign and select the classes)
   a) com.boeing.irip.model.TcItem$Dataset
   b) com.boeing.irip.model.TcItem$Dataset$NamedReference
  Note: Notice the '$' convention.
3) Save work
4) Build package
5) Will get errors


I guess I would have to use (advanced) class name: to 'rename' the classes (or 
replace the '$' with '.') in order for a success build


Thank You,
Tony Nguyen
IPDM Advanced Development
The Boeing Company
714-896-1086" value="+17148961086" target="_blank">714-896-1086
[hidden email]




From: manstis [via Drools] [mailto:[hidden 
email]]
Sent: Wednesday, June 13, 2012 5:04 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

I tested again and it appears fine for me.

I used the BA5_TCModel JAR included in your repository export, with the 
following steps:-

1) Create a new package
2) Import POJO Model JAR
3) Re-create rule "Test _Rule01".
4) Validated OK.
5) Package built OK.

I've attached my repository export to the JIRA for your information (package 
t1).

It was too big to include in this email (email was pending approval before 
posting to mailing list due to it's size... and that, I guess, will never 
happen).

With kind regards,

Mike

On 12 June 2012 23:01, Michael Anstis <[hidden 
email]> wrote:
Sure will do.


On 12 June 2012 22:50, TonyN <[hidden 
email]> wrote:
Hi,

Latest release 5.4.0 final was supposed to include a fix for an issue that I
reported earlier (#1873).  However, I am still seeing the problem

https://issues.jboss.org/browse/GUVNOR-1873

Wondering if you can take a look...

thx,
Tony

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
[hidden email]

Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

2012-06-13 Thread TonyN
Correction...trying to do a 'login' or 'reply' in Drools: User Forum and ran 
into below error...




From: Nguyen, Tony N
Sent: Wednesday, June 13, 2012 12:44 PM
To: 'manstis [via Drools]'
Subject: RE: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Mike,
I am trying to raise an JRA issue (per your email below) but running into NAML 
issue

Error:
Oops... An error has occurred
Please contact Nabble Support and explain what you 
did to cause this error. Your feedback is very important to us.
[http://drools.46999.n3.nabble.com/images/tool.png] Go to NAML 
Editor
More Details
Error 500

macroName is null

Message: macroName is null

RequestURI: /template/NamlServlet.jtp

Server: n3.nabble.com

Caused by:

From: manstis [via Drools] [mailto:ml-node+s46999n4017917...@n3.nabble.com]
Sent: Wednesday, June 13, 2012 8:49 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

Looks like a different bug to the one I fixed :(

My fix related to when a POJO model is uploaded and the imports automatically 
generated. The drop-down you have identified still needs fixing.

The "Advanced view" is the work-around at present (but you should find the 
imports are all present and correct after uploading a POJO JAR).

Would you be so kind as to raise another JIRA (and assign to me)?

Thanks,

Mike

On 13 June 2012 16:32, TonyN <[hidden 
email]> wrote:
Mike,

thanks for taking the time to look into this.  This is my observation:

1) Copy Test_R02 from package 'Test_Package' to package 't1'
2) Copy Function 'compare_revs' from package 'Test_Package' to package 't1'
3) Build Package
4) Got a 'Success' result.
5) Notice that the following classes appeared in the 'Configuration: Import 
Types'  text area widget
a) 'com.boeing.irip.model.TcItem.Dataset'
b) 'com.boeing.irip.model.TcItem.Dataset.NamedReference'
   Note:  notice the '.' (dot) convention.  (Did you import them in this way)?

To show the failure:
1) Remove the above 2 classes from 'Configuration: Import Types'  text area 
widget.
2) Re-Import them back in as-is (click on the + sign and select the classes)
   a) com.boeing.irip.model.TcItem$Dataset
   b) com.boeing.irip.model.TcItem$Dataset$NamedReference
  Note: Notice the '$' convention.
3) Save work
4) Build package
5) Will get errors


I guess I would have to use (advanced) class name: to 'rename' the classes (or 
replace the '$' with '.') in order for a success build


Thank You,
Tony Nguyen
IPDM Advanced Development
The Boeing Company
714-896-1086
[hidden email]




From: manstis [via Drools] [mailto:[hidden 
email]]
Sent: Wednesday, June 13, 2012 5:04 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

I tested again and it appears fine for me.

I used the BA5_TCModel JAR included in your repository export, with the 
following steps:-

1) Create a new package
2) Import POJO Model JAR
3) Re-create rule "Test _Rule01".
4) Validated OK.
5) Package built OK.

I've attached my repository export to the JIRA for your information (package 
t1).

It was too big to include in this email (email was pending approval before 
posting to mailing list due to it's size... and that, I guess, will never 
happen).

With kind regards,

Mike

On 12 June 2012 23:01, Michael Anstis <[hidden 
email]> wrote:
Sure will do.


On 12 June 2012 22:50, TonyN <[hidden 
email]> wrote:
Hi,

Latest release 5.4.0 final was supposed to include a fix for an issue that I
reported earlier (#1873).  However, I am still seeing the problem

https://issues.jboss.org/browse/GUVNOR-1873

Wondering if you can take a look...

thx,
Tony

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880p4017907.html
To unsubscribe from 5.4.0 Final and issue: GUVNOR-1873, click here.
NAML

Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

2012-06-13 Thread TonyN
Hi Mike,
I am trying to raise an JRA issue (per your email below) but running into NAML 
issue

Error:
Oops... An error has occurred
Please contact Nabble Support and explain what you 
did to cause this error. Your feedback is very important to us.
[http://drools.46999.n3.nabble.com/images/tool.png] Go to NAML 
Editor
More Details
Error 500

macroName is null

Message: macroName is null

RequestURI: /template/NamlServlet.jtp

Server: n3.nabble.com

Caused by:

From: manstis [via Drools] [mailto:ml-node+s46999n4017917...@n3.nabble.com]
Sent: Wednesday, June 13, 2012 8:49 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

Looks like a different bug to the one I fixed :(

My fix related to when a POJO model is uploaded and the imports automatically 
generated. The drop-down you have identified still needs fixing.

The "Advanced view" is the work-around at present (but you should find the 
imports are all present and correct after uploading a POJO JAR).

Would you be so kind as to raise another JIRA (and assign to me)?

Thanks,

Mike

On 13 June 2012 16:32, TonyN <[hidden 
email]> wrote:
Mike,

thanks for taking the time to look into this.  This is my observation:

1) Copy Test_R02 from package 'Test_Package' to package 't1'
2) Copy Function 'compare_revs' from package 'Test_Package' to package 't1'
3) Build Package
4) Got a 'Success' result.
5) Notice that the following classes appeared in the 'Configuration: Import 
Types'  text area widget
a) 'com.boeing.irip.model.TcItem.Dataset'
b) 'com.boeing.irip.model.TcItem.Dataset.NamedReference'
   Note:  notice the '.' (dot) convention.  (Did you import them in this way)?

To show the failure:
1) Remove the above 2 classes from 'Configuration: Import Types'  text area 
widget.
2) Re-Import them back in as-is (click on the + sign and select the classes)
   a) com.boeing.irip.model.TcItem$Dataset
   b) com.boeing.irip.model.TcItem$Dataset$NamedReference
  Note: Notice the '$' convention.
3) Save work
4) Build package
5) Will get errors


I guess I would have to use (advanced) class name: to 'rename' the classes (or 
replace the '$' with '.') in order for a success build


Thank You,
Tony Nguyen
IPDM Advanced Development
The Boeing Company
714-896-1086
[hidden email]




From: manstis [via Drools] [mailto:[hidden 
email]]
Sent: Wednesday, June 13, 2012 5:04 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

I tested again and it appears fine for me.

I used the BA5_TCModel JAR included in your repository export, with the 
following steps:-

1) Create a new package
2) Import POJO Model JAR
3) Re-create rule "Test _Rule01".
4) Validated OK.
5) Package built OK.

I've attached my repository export to the JIRA for your information (package 
t1).

It was too big to include in this email (email was pending approval before 
posting to mailing list due to it's size... and that, I guess, will never 
happen).

With kind regards,

Mike

On 12 June 2012 23:01, Michael Anstis <[hidden 
email]> wrote:
Sure will do.


On 12 June 2012 22:50, TonyN <[hidden 
email]> wrote:
Hi,

Latest release 5.4.0 final was supposed to include a fix for an issue that I
reported earlier (#1873).  However, I am still seeing the problem

https://issues.jboss.org/browse/GUVNOR-1873

Wondering if you can take a look...

thx,
Tony

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880p4017907.html
To unsubscribe from 5.4.0 Final and issue: GUVNOR-1873, click here.
NAML

__

Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

2012-06-13 Thread TonyN
The 2 sessions that you saw were actually 2 different guvnors running on 2 
different application servers...one was running 5.2.0 Final and the other  is 
5.4.0 Final

But in any case, I closed both and retried again (5.4.0 final) and still the 
same problem...

From: manstis [via Drools] [mailto:ml-node+s46999n4017922...@n3.nabble.com]
Sent: Wednesday, June 13, 2012 10:48 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

That error, I can only guess at.

Your screenshot shows two sessions to (presumably the same) Guvnor instance 
(i.e. 2 browser windows).

Is there any possibility you changed the same asset in the two sessions?

With a single session I can create a new POJO model, or uploaded new content to 
an existing POJO model, in a package without problem.

BCC'ed a colleague who might have seen it before

Jervis, any ideas?

On 13 June 2012 18:08, TonyN <[hidden 
email]> wrote:
Hi Mike,

I was trying to re-import the old POJO to see how the classes are imported and 
ran into this error:

1) Create/upload new POJO
2) Entering in new name
3) Hit OK
4) Get the below error.

Also failed when trying to update existing modelwhat's going on?





From: manstis [via Drools] [mailto:[hidden 
email]]
Sent: Wednesday, June 13, 2012 8:49 AM

To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

Looks like a different bug to the one I fixed :(

My fix related to when a POJO model is uploaded and the imports automatically 
generated. The drop-down you have identified still needs fixing.

The "Advanced view" is the work-around at present (but you should find the 
imports are all present and correct after uploading a POJO JAR).

Would you be so kind as to raise another JIRA (and assign to me)?

Thanks,

Mike

On 13 June 2012 16:32, TonyN <[hidden 
email]> wrote:
Mike,

thanks for taking the time to look into this.  This is my observation:

1) Copy Test_R02 from package 'Test_Package' to package 't1'
2) Copy Function 'compare_revs' from package 'Test_Package' to package 't1'
3) Build Package
4) Got a 'Success' result.
5) Notice that the following classes appeared in the 'Configuration: Import 
Types'  text area widget
a) 'com.boeing.irip.model.TcItem.Dataset'
b) 'com.boeing.irip.model.TcItem.Dataset.NamedReference'
   Note:  notice the '.' (dot) convention.  (Did you import them in this way)?

To show the failure:
1) Remove the above 2 classes from 'Configuration: Import Types'  text area 
widget.
2) Re-Import them back in as-is (click on the + sign and select the classes)
   a) com.boeing.irip.model.TcItem$Dataset
   b) com.boeing.irip.model.TcItem$Dataset$NamedReference
  Note: Notice the '$' convention.
3) Save work
4) Build package
5) Will get errors


I guess I would have to use (advanced) class name: to 'rename' the classes (or 
replace the '$' with '.') in order for a success build


Thank You,
Tony Nguyen
IPDM Advanced Development
The Boeing Company
714-896-1086" value="+17148961086" target="_blank">714-896-1086
[hidden email]




From: manstis [via Drools] [mailto:[hidden 
email]]
Sent: Wednesday, June 13, 2012 5:04 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

I tested again and it appears fine for me.

I used the BA5_TCModel JAR included in your repository export, with the 
following steps:-

1) Create a new package
2) Import POJO Model JAR
3) Re-create rule "Test _Rule01".
4) Validated OK.
5) Package built OK.

I've attached my repository export to the JIRA for your information (package 
t1).

It was too big to include in this email (email was pending approval before 
posting to mailing list due to it's size... and that, I guess, will never 
happen).

With kind regards,

Mike

On 12 June 2012 23:01, Michael Anstis <[hidden 
email]> wrote:
Sure will do.


On 12 June 2012 22:50, TonyN <[hidden 
email]> wrote:
Hi,

Latest release 5.4.0 final was supposed to include a fix for an issue that I
reported earlier (#1873).  However, I am still seeing the problem

https://issues.jboss.org/browse/GUVNOR-1873

Wondering if you can take a look...

thx,
Tony

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users




Re: [rules-users] Programatically filled Enum not getting loaded

2012-06-13 Thread Michael Anstis
Sounds like a bug to me.

Please raise a JIRA at https://issues.jboss.org/browse/GUVNOR, including a
self-contained repository export and your description below.

With kind regards,

Mike

On 13 June 2012 16:47, Sandjaja, Dominik wrote:

> **
>
> I use Guvnor 5.4.0 with the following Assets:
>
> Enum:
>
>   'Enums.Modules' : (new de.itm.util.DroolsEnumHelper()).loadModules()
>
> DSL:
>
>   [when]Testmodule {module:ENUM:Enums.Modules} is just for
> testing={module} : Cylinder()
>
> DroolsEnumHelper-Class:
>
>   * public* List loadModules() {
>
> List values =* new* ArrayList();
>
>* for* (Module module : Module.*values*()) {
>
>values.add(module.getModuleName() + "=" +
> module.getDisplayName());
>
> }
>
>* return* values;
>
> }
>
> When running the “Source->Validate” in the Enum-Editor, I see the method
> getting called (being connected to the JBoss for Debugging). But if I use
> the DSL rule in the guided editor, I can select the rule but the dropdown
> field stays grayed out. The loadModules() method isn’t even called, no
> getting stuck in my breakpoint!
>
> Anyone an idea why and how this happens? Am I doing something totally
> wrong?
>
> Thanks
>
> Dominik
>
> ***…** *
>
> mit freundlichen Grüßen / kind regards
>
> Dominik Sandjaja
>
> Fon:  +49 (0) 203 60878 183
>
> Mobil+49 (0) 162 2624490
> Fax:  +49 (0) 203 60878 22
>
> e-mail: *dominik.sandj...@it-motive.de*
>
>
>
> ***it-motive AG*
>
> Zum Walkmüller 10-12
> 47269 Duisburg
>
> *i...@it-motive.de* 
>
> *http://www.it-motive.de* 
>
> ***…… *
>
> Vorsitzender des Aufsichtsrats: Dipl.-Ing. Klaus Straub
>
> Vorstand: Horst-Dieter Deelmann (Vors.),  Matthias Heming, Christoph Tim
> Klose
>
> HRB 9207, Amtsgericht Duisburg
>
>
> ___
> 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 read DRL files not in resource classpath?

2012-06-13 Thread Daniel Souza
At ResourceFactory you have the methods:
  ResourceFactory.*newUrlResource*("http://localhost:8080/rules/myRule.drl";)
 
ResourceFactory.*newClassPathResource*("your-project-path/path-rules/myRule.drl")
  ResourceFactory.*newFileResource*("C:\path-rules\myRule.drl")

  you have other methods, you can use InputStream, Reader and others.
  you can mix the recources. You can get an resource in the Web with
newUrlResource, you can get your resource inside your class path, you can
get the resource in your filesystem and mix all resources to build your
knowledge base.

A sample code to show this mix:
  KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
  //kbuilder.add( ResourceFactory.newUrlResource(
droolsResourceMap.get("blastManagerRule") ), ResourceType.DRL );
  *kbuilder.add(
ResourceFactory.newClassPathResource("domain/BiologistDomain.dsl"),
ResourceType.DSL );
  kbuilder.add(ResourceFactory.newUrlResource(resource), ResourceType.DSLR
);*
  if (kbuilder.hasErrors()) {
System.err.println(kbuilder.getErrors().toString());
  }

  KnowledgeBase kbase = kbuilder.newKnowledgeBase();
  kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());

  // here you start your knowledge session

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-read-DRL-files-not-in-resource-classpath-tp4017885p4017918.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] Programatically filled Enum not getting loaded

2012-06-13 Thread Sandjaja, Dominik
I use Guvnor 5.4.0 with the following Assets:

Enum:
  'Enums.Modules' : (new de.itm.util.DroolsEnumHelper()).loadModules()

DSL:
  [when]Testmodule {module:ENUM:Enums.Modules} is just for testing={module} : 
Cylinder()

DroolsEnumHelper-Class:
   public List loadModules() {
List values = new ArrayList();
for (Module module : Module.values()) {
   values.add(module.getModuleName() + "=" + module.getDisplayName());
}
return values;
}

When running the "Source->Validate" in the Enum-Editor, I see the method 
getting called (being connected to the JBoss for Debugging). But if I use the 
DSL rule in the guided editor, I can select the rule but the dropdown field 
stays grayed out. The loadModules() method isn't even called, no getting stuck 
in my breakpoint!

Anyone an idea why and how this happens? Am I doing something totally wrong?

Thanks
Dominik


... 
mit freundlichen Grüßen / kind regards
Dominik Sandjaja
Fon:  +49 (0) 203 60878 183
Mobil+49 (0) 162 2624490
Fax:  +49 (0) 203 60878 22
e-mail: dominik.sandj...@it-motive.de
 
it-motive AG
Zum Walkmüller 10-12  
47269 Duisburg
i...@it-motive.de
http://www.it-motive.de  
.. 
Vorsitzender des Aufsichtsrats: Dipl.-Ing. Klaus Straub 
Vorstand: Horst-Dieter Deelmann (Vors.),  Matthias Heming, Christoph Tim Klose
HRB 9207, Amtsgericht Duisburg


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


Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

2012-06-13 Thread TonyN
Mike,

thanks for taking the time to look into this.  This is my observation:

1) Copy Test_R02 from package 'Test_Package' to package 't1'
2) Copy Function 'compare_revs' from package 'Test_Package' to package 't1'
3) Build Package
4) Got a 'Success' result.
5) Notice that the following classes appeared in the 'Configuration: Import 
Types'  text area widget
a) 'com.boeing.irip.model.TcItem.Dataset'
b) 'com.boeing.irip.model.TcItem.Dataset.NamedReference'
   Note:  notice the '.' (dot) convention.  (Did you import them in this way)?

To show the failure:
1) Remove the above 2 classes from 'Configuration: Import Types'  text area 
widget.
2) Re-Import them back in as-is (click on the + sign and select the classes)
   a) com.boeing.irip.model.TcItem$Dataset
   b) com.boeing.irip.model.TcItem$Dataset$NamedReference
  Note: Notice the '$' convention.
3) Save work
4) Build package
5) Will get errors


I guess I would have to use (advanced) class name: to 'rename' the classes (or 
replace the '$' with '.') in order for a success build


Thank You,
Tony Nguyen
IPDM Advanced Development
The Boeing Company
714-896-1086
tony.n.ngu...@boeing.com




From: manstis [via Drools] [mailto:ml-node+s46999n4017907...@n3.nabble.com]
Sent: Wednesday, June 13, 2012 5:04 AM
To: Nguyen, Tony N
Subject: Re: [rules-users] 5.4.0 Final and issue: GUVNOR-1873

Hi Tony,

I tested again and it appears fine for me.

I used the BA5_TCModel JAR included in your repository export, with the 
following steps:-

1) Create a new package
2) Import POJO Model JAR
3) Re-create rule "Test _Rule01".
4) Validated OK.
5) Package built OK.

I've attached my repository export to the JIRA for your information (package 
t1).

It was too big to include in this email (email was pending approval before 
posting to mailing list due to it's size... and that, I guess, will never 
happen).

With kind regards,

Mike

On 12 June 2012 23:01, Michael Anstis <[hidden 
email]> wrote:
Sure will do.


On 12 June 2012 22:50, TonyN <[hidden 
email]> wrote:
Hi,

Latest release 5.4.0 final was supposed to include a fix for an issue that I
reported earlier (#1873).  However, I am still seeing the problem

https://issues.jboss.org/browse/GUVNOR-1873

Wondering if you can take a look...

thx,
Tony

--
View this message in context: 
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



If you reply to this email, your message will be added to the discussion below:
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880p4017907.html
To unsubscribe from 5.4.0 Final and issue: GUVNOR-1873, click 
here.
NAML


--
View this message in context: 
http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880p4017915.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] Is there a logical not available

2012-06-13 Thread learner
I have a scenario like below

Rule a

When

! (

MyObject(aaa == “bbb”) &&

MyObject2(bbb == “aaa”)

)

Then

// do smth

End

I’m looking for an operator to reverse the evaluation result of the
expression in the brackets. Is this possible

--
View this message in context: 
http://drools.46999.n3.nabble.com/Is-there-a-logical-not-available-tp4017914.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] Declarative model does not replicate

2012-06-13 Thread devan.vanree...@gmail.com
Hi there, 

I am using Guvnor 5.0.0

I have a Guvnor running in a cluster, Guvnor uses Oracle DB for the repo.
When I add rules, functions or upload a POJO model jar, the different guvnor
instances are in synch, however this is not the case for my declarative
model which is not in synch.

My apologies if this should be posted in the JackRabbit forum rather than
this one but if you have any suggestions it would be appreciated. I will
post there as well.

Many thanks
Devan

--
View this message in context: 
http://drools.46999.n3.nabble.com/Declarative-model-does-not-replicate-tp4017912.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] BigDecimal comparison

2012-06-13 Thread devan.vanree...@gmail.com
Thanks Vincent.

--
View this message in context: 
http://drools.46999.n3.nabble.com/BigDecimal-comparison-tp4017841p4017911.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] Is it possible to implement something similar to a SQL join in Drools ?

2012-06-13 Thread soumya_sd
Is it possible to have a rule that creates something similar to a SQL join. 

For example, the working memory has the following: 

List and List. 

In the "if" of the drl rule we want to check 

if Fact_A.someAttribute (some_condition) Fact_B.someOtherAttribute
//some_condition could be .equals(), .startsWith(), notEquals() ...

then 
 //somehow Fact_A and Fact_B 

Any examples or pointers would be greatly appreciated. 

Thanks. 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Is-it-possible-to-implement-something-similar-to-a-SQL-join-in-Drools-tp4017908.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] Is it possible to implement something similar to a SQL join in Drools ?

2012-06-13 Thread Michael Anstis
Yes, much the same as you would with a RDBMS.

You'll have to insert the individual Lists (either by inserting their
members, or by using "from").

Outer product:-

when
FactA( )
FactB( )
then

Inner join:-

when
FactA( $pk : pk)
FactB( fk == $pk )
then

left and right joins follow similarly (you'd have to check if the outer key
equals or is null).


On 13 June 2012 13:04, soumya_sd  wrote:

> Is it possible to have a rule that creates something similar to a SQL join.
>
> For example, the working memory has the following:
>
> List and List.
>
> In the "if" of the drl rule we want to check
>
> if Fact_A.someAttribute (some_condition) Fact_B.someOtherAttribute
> //some_condition could be .equals(), .startsWith(), notEquals() ...
>
> then
>  //somehow Fact_A and Fact_B
>
> Any examples or pointers would be greatly appreciated.
>
> Thanks.
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-it-possible-to-implement-something-similar-to-a-SQL-join-in-Drools-tp4017908.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] Else condition in drl file

2012-06-13 Thread FrankVhh
Hi,

You could put them all in the same activation-group and give low salience to
the default rule.

See documentation for more details. It seems they are doing a bit of
maintenance on the website, so you might have to be patient for a while.

Regards,
Frank


learner wrote
> 
> Hi,
> 
> I have a scenario like
> 
> if(value == 200){
>   // then do something
> }else if(value == 100){
> // then do something
> }else{
> value = 0
> }
> 
> I created drl with 3 rules
> Rule 1 : value  equal 200
> Rule 2 : value  equal 100
> Rule 3 : value not equal to 100 or 200(ie by value!=200 & value!=100 ).
> 
> Is there a way by which I can simplify the condition in rule 3.
> 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Else-condition-in-drl-file-tp4017903p4017909.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] 5.4.0 Final and issue: GUVNOR-1873

2012-06-13 Thread Michael Anstis
Hi Tony,

I tested again and it appears fine for me.

I used the BA5_TCModel JAR included in your repository export, with the
following steps:-

1) Create a new package
2) Import POJO Model JAR
3) Re-create rule "Test _Rule01".
4) Validated OK.
5) Package built OK.

I've attached my repository export to the JIRA for your information
(package t1).

It was too big to include in this email (email was pending approval before
posting to mailing list due to it's size... and that, I guess, will never
happen).

With kind regards,

Mike

On 12 June 2012 23:01, Michael Anstis  wrote:

> Sure will do.
>
>
> On 12 June 2012 22:50, TonyN  wrote:
>
>> Hi,
>>
>> Latest release 5.4.0 final was supposed to include a fix for an issue
>> that I
>> reported earlier (#1873).  However, I am still seeing the problem
>>
>> https://issues.jboss.org/browse/GUVNOR-1873
>>
>> Wondering if you can take a look...
>>
>> thx,
>> Tony
>>
>> --
>> View this message in context:
>> http://drools.46999.n3.nabble.com/5-4-0-Final-and-issue-GUVNOR-1873-tp4017880.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] Exit from drl file when the first rule is satisfied

2012-06-13 Thread Wolfgang Laun
>From the "Expert" manual, section "Right Hand Side" (which you should
have read):

The call drools.halt() terminates rule execution immediately. This is
required for returning control to the point whence the current session
was put to work with fireUntilHalt().

-W


On 13/06/2012, learner  wrote:
> Is there any exit statement in drl file to achieve the same.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Exit-from-drl-file-when-the-first-rule-is-satisfied-tp4017899p4017904.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] Exit from drl file when the first rule is satisfied

2012-06-13 Thread learner
Is there any exit statement in drl file to achieve the same.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Exit-from-drl-file-when-the-first-rule-is-satisfied-tp4017899p4017904.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] Else condition in drl file

2012-06-13 Thread learner
Hi,

I have a scenario like

if(value == 200){
  // then do something
}else if(value == 100){
// then do something
}else{
value = 0
}

I created drl with 3 rules
Rule 1 : value  equal 200
Rule 2 : value  equal 100
Rule 3 : value not equal to 100 or 200(ie by value!=200 & value!=100 ).

Is there a way by which I can simplify the condition in rule 3.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Else-condition-in-drl-file-tp4017903.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] Managing Sets of Rules

2012-06-13 Thread Tim Lee
Thanks Wolfgang, I'll check it out.

Tim.

On 13 June 2012 11:32, Wolfgang Laun  wrote:

> Agenda Group: a set of rules with a common agenda group identifier
> that can be activated via the API. The identifier can be set for
> decision tables. See the Expert manual on both counts.
>
> -W
>
>
> On 13/06/2012, tlee  wrote:
> > Hi,
> >
> > Are there any guidelines or recommendations for how best to isolate
> > different groups of rules?  For example, I'm using decision tables to do
> > some (initially) simple inter-system value mappings/translation.  The
> > generated rules look like this:
> >
> > Decision Table 1:
> >
> > rule "mapCountry"
> > salience 65496
> > when
> > String(toString == 'SRI LANKA')
> > then
> > result.put('countryCode', 'apac.sri-lanka');
> > drools.halt();
> > end
> >
> > I will have other decision tables that also match against String values.
> >
> > If I want to isolate these decision tables so that only one set of the
> > rules
> > fire when calling 'execute' on the knowledge session, should I put them
> in
> > different knowledge bases?  Or is there another way?  Or am I going about
> > this the wrong way all together?
> >
> > Many Thanks,
> >
> > Tim.
> >
> > --
> > View this message in context:
> > http://drools.46999.n3.nabble.com/Managing-Sets-of-Rules-tp4017898.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] Exit from drl file when the first rule is satisfied

2012-06-13 Thread Wolfgang Laun
On 13/06/2012, learner  wrote:
> Hi,
>
> I have a drl file that has 3 rules. I want to exit from the drl file if the
> 1st rule is satisfied. Is this possible.
>

kSession.fireAllRules( 1 );

-W


> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Exit-from-drl-file-when-the-first-rule-is-satisfied-tp4017899.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] Managing Sets of Rules

2012-06-13 Thread Wolfgang Laun
Agenda Group: a set of rules with a common agenda group identifier
that can be activated via the API. The identifier can be set for
decision tables. See the Expert manual on both counts.

-W


On 13/06/2012, tlee  wrote:
> Hi,
>
> Are there any guidelines or recommendations for how best to isolate
> different groups of rules?  For example, I'm using decision tables to do
> some (initially) simple inter-system value mappings/translation.  The
> generated rules look like this:
>
> Decision Table 1:
>
> rule "mapCountry"
> salience 65496
> when
> String(toString == 'SRI LANKA')
> then
> result.put('countryCode', 'apac.sri-lanka');
> drools.halt();
> end
>
> I will have other decision tables that also match against String values.
>
> If I want to isolate these decision tables so that only one set of the
> rules
> fire when calling 'execute' on the knowledge session, should I put them in
> different knowledge bases?  Or is there another way?  Or am I going about
> this the wrong way all together?
>
> Many Thanks,
>
> Tim.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Managing-Sets-of-Rules-tp4017898.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] Exit from drl file when the first rule is satisfied

2012-06-13 Thread learner
Hi,

I have a drl file that has 3 rules. I want to exit from the drl file if the
1st rule is satisfied. Is this possible.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Exit-from-drl-file-when-the-first-rule-is-satisfied-tp4017899.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] Managing Sets of Rules

2012-06-13 Thread tlee
Hi,

Are there any guidelines or recommendations for how best to isolate
different groups of rules?  For example, I'm using decision tables to do
some (initially) simple inter-system value mappings/translation.  The
generated rules look like this:

Decision Table 1:

rule "mapCountry"
salience 65496
when
String(toString == 'SRI LANKA')
then
result.put('countryCode', 'apac.sri-lanka');
drools.halt();
end

I will have other decision tables that also match against String values.

If I want to isolate these decision tables so that only one set of the rules
fire when calling 'execute' on the knowledge session, should I put them in
different knowledge bases?  Or is there another way?  Or am I going about
this the wrong way all together?

Many Thanks,

Tim.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Managing-Sets-of-Rules-tp4017898.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 declare an identifier and use it?

2012-06-13 Thread Wolfgang Laun
On 13/06/2012, yasodhara srinivas  wrote:
> getInfo() will return TType for me.
>

Hopefully as a method of THeaderType?!

Check your fact data. Is it what you expect it to be? Add a couple of
rules that just show what you have in tems of THeaderType and
TLineType, respectively.

The combined condition is true if
   offType == "Local"
   and
   ( qType != null
   or
 info/TType == "Offline" ) //  or any other value, just not "Online"

Note that this is true for "Online" as well, just as long as qType !=
null - which isn't quite what you explained in the original mail.

-W


>
>
> On Wed, Jun 13, 2012 at 3:06 PM, Wolfgang Laun
> wrote:
>
>> Another observation: If the relevant field is TType, why do you call
>> getInfo()? One would expect getTType(), according to the usual bean
>> nomenclature.
>> -W
>>
>> On 13/06/2012, vysrinivas  wrote:
>> > sorry. this is my declaration.
>> >
>> > 
>> >
>> > 
>> >
>> > THeaderType
>> > 
>> >
>> > 
>> > TLineType
>> > 
>> >
>> > 
>> > getQType(TReqHeader) != null
>> > ||
>> > !getInfo(TReqHeader).equals("Online")
>> > 
>> >
>> >
>> > 
>> > getOffType(TReqLine).equals("Local")
>> > 
>> >
>> > --
>> > View this message in context:
>> >
>> http://drools.46999.n3.nabble.com/how-to-declare-an-identifier-and-use-it-tp4017888p4017892.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
>>
>
>
>
> --
>
> regards,
> Srinivas.
> 9535692441
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] how to declare an identifier and use it?

2012-06-13 Thread yasodhara srinivas
getInfo() will return TType for me.



On Wed, Jun 13, 2012 at 3:06 PM, Wolfgang Laun wrote:

> Another observation: If the relevant field is TType, why do you call
> getInfo()? One would expect getTType(), according to the usual bean
> nomenclature.
> -W
>
> On 13/06/2012, vysrinivas  wrote:
> > sorry. this is my declaration.
> >
> > 
> >
> > 
> >
> > THeaderType
> > 
> >
> > 
> > TLineType
> > 
> >
> > 
> > getQType(TReqHeader) != null
> > || !getInfo(TReqHeader).equals("Online")
> > 
> >
> >
> > 
> > getOffType(TReqLine).equals("Local")
> > 
> >
> > --
> > View this message in context:
> >
> http://drools.46999.n3.nabble.com/how-to-declare-an-identifier-and-use-it-tp4017888p4017892.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
>



-- 

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


Re: [rules-users] how to declare an identifier and use it?

2012-06-13 Thread Wolfgang Laun
Another observation: If the relevant field is TType, why do you call
getInfo()? One would expect getTType(), according to the usual bean
nomenclature.
-W

On 13/06/2012, vysrinivas  wrote:
> sorry. this is my declaration.
>
> 
>
> 
>
> THeaderType
> 
>
> 
> TLineType
> 
>
> 
> getQType(TReqHeader) != null
> || !getInfo(TReqHeader).equals("Online")
> 
>
>
> 
> getOffType(TReqLine).equals("Local")
> 
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/how-to-declare-an-identifier-and-use-it-tp4017888p4017892.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 declare an identifier and use it?

2012-06-13 Thread vysrinivas
sorry. this is my declaration.



   

   THeaderType
   

   
   TLineType
   

   
   getQType(TReqHeader) != null
   || !getInfo(TReqHeader).equals("Online")
   


   
   getOffType(TReqLine).equals("Local")
   


--
View this message in context: 
http://drools.46999.n3.nabble.com/how-to-declare-an-identifier-and-use-it-tp4017888p4017894.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 declare an identifier and use it?

2012-06-13 Thread vysrinivas
sorry. this is my declaration.





THeaderType



TLineType



getQType(TReqHeader) != null
|| !getInfo(TReqHeader).equals("Online")




getOffType(TReqLine).equals("Local")


--
View this message in context: 
http://drools.46999.n3.nabble.com/how-to-declare-an-identifier-and-use-it-tp4017888p4017892.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 declare an identifier and use it?

2012-06-13 Thread yasodhara srinivas
sorry. this is my declaration.




THeaderType



TLineType



getQType(TReqHeader) != null
|| !getInfo(TReqHeader).equals("Online")




getOffType(TReqLine).equals("Local")


On Wed, Jun 13, 2012 at 2:02 PM, Wolfgang Laun wrote:

> On 13/06/2012, vysrinivas  wrote:
> >
> > As i am declaring given below.
> >
> > 
> >
> > 
> > THeaderType
> > 
> >
> > 
> > TLineType
> > 
> >
> > 
> > getQType(TReqHeader) != null
> > || !getInfo(TReqHeader).equals("Online")
> > 
> >
> > 
> > getOffType(TReqLine).equals("Local")
> > 
> >
>
> Although this is not a notation that I consider eye-friendly, here's
> one observation:
> In the 2nd condition, there is "TReqLine", the identifier declared in
> the 2nd declaration. But in the 1st condition, in the corresponding
> place, there's "TReqHeader", which isn't declared anywhere.
>
> -W
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 

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


Re: [rules-users] how to declare an identifier and use it?

2012-06-13 Thread Wolfgang Laun
On 13/06/2012, vysrinivas  wrote:
>
> As i am declaring given below.
>
> 
>
> 
> THeaderType
> 
>
> 
> TLineType
> 
>
> 
> getQType(TReqHeader) != null
> || !getInfo(TReqHeader).equals("Online")
> 
>
> 
> getOffType(TReqLine).equals("Local")
> 
>

Although this is not a notation that I consider eye-friendly, here's
one observation:
In the 2nd condition, there is "TReqLine", the identifier declared in
the 2nd declaration. But in the 1st condition, in the corresponding
place, there's "TReqHeader", which isn't declared anywhere.

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


Re: [rules-users] How to read DRL files not in resource classpath?

2012-06-13 Thread Geoffrey De Smet

Yes, there is.
See
  
http://docs.jboss.org/drools/release/5.4.0.Final/drools-planner-docs/html_single/index.html#d0e3440




  5.3.4.2.2. A RuleBase (possibly defined by Guvnor)

If you prefer to build the |RuleBase| yourself or if you're combining 
Planner with Guvnor, you can set the |RuleBase| on the |SolverFactory| 
before building the |Solver|:


 
solverFactory.getSolverConfig().getScoreDirectorFactoryConfig.setRuleBase(ruleBase);



Op 13-06-12 09:01, Charles schreef:

I am using Drools Planner.
Is there any way to separate rules.drl from program.jar.

Project
- program.jar
- rules.drl

Currently, Drools Planner only search for .drl file within resource
classpath.

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-read-DRL-files-not-in-resource-classpath-tp4017885.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



--
With kind regards,
Geoffrey De Smet

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


Re: [rules-users] Using 'from {x}.field' in DSL

2012-06-13 Thread Wolfgang Laun
On 13/06/2012, Sandjaja, Dominik  wrote:
> Hello Wolfgang, hello everybody,
>
> Nice one, thanks for the idea! This one works for now, but is there a way to
> automatically assign random variable names to the RHS of the DSL? So the
> user won't have to explicitly set a variable in the DSL which is only needed
> for internal purposes.

This is one thing I've occasionally missed, too, in my experiments
with DSLs. It wouldn't be too difficult to add, and patch/pull
requests are always welcome with the Drools team.

If at least one of the variables differs between repeated uses of the
DSL phrase, you might consider using this text (if its characters are
always suitable!) as part of the binding variable name, e.g.

 [when][]The field {field} in the module {module} contains value {value}=
  {value}Obj : {module} ( {field} != null) String(
this.equalsIgnoreCase( "{value}" )  ) from {value}Obj.{field}

BTW, consider defining a custom operator which would let you write the
much simpler pattern
   Module( field spells "value" )
You can make a trivial clone from the implementation of "contains",
shouldn't take more than 5 minutes ;-)   Some hints can be found at
http://members.inode.at/w.laun/drools/CustomOperatorHowTo.html

Cheers
-W


>
> Thanks
> Dominik
>
> -Ursprüngliche Nachricht-
> Von: rules-users-boun...@lists.jboss.org
> [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Wolfgang Laun
> Gesendet: Dienstag, 12. Juni 2012 19:46
> An: Rules Users List
> Cc: Edson Tirelli
> Betreff: Re: [rules-users] Using 'from {x}.field' in DSL
>
> There is a bug in the DSL parser: after '=', a couple of variable references
> merely separated by a period isn't recognized.
>
> As a workaround, use this:
>
> [when][]The field {field} in the module {module} contains value {value} as
> {abc} =
>  {abc}x : {module} ( {field} != null) String(
> this.equalsIgnoreCase("{value}") ) from {abc}x.{field}
>
> -W
>
>
> On 12/06/2012, Sandjaja, Dominik  wrote:
>> There is no expanded DRL. If I take that line into the DSL, I can't
>> even validate the DSL and if I have the line in it, I can't select any
>> DSL statements for rules in Guvnor.
>>
>>
>>
>> BTW, I am using Drools and Guvnor 5.4.0.
>>
>>
>>
>> Von: rules-users-boun...@lists.jboss.org
>> [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Wolfgang
>> Laun
>> Gesendet: Dienstag, 12. Juni 2012 17:31
>> An: Rules Users List
>> Betreff: Re: [rules-users] Using 'from {x}.field' in DSL
>>
>>
>>
>> Have you checked the expanded DRL? What does this line look like?
>>
>> -W
>>
>> On 12 June 2012 17:06, Sandjaja, Dominik
>> 
>> wrote:
>>
>> I have the following Drools DSL "sentence":
>>
>> [when]The field {field} in the module {module} contains value
>> {value}=$a : {module} ( {field} != null)
>>
>>   String( this.equalsIgnoreCase("{value}") ) from $a.{field}
>>
>> where the `field` is a `Set` of Strings.
>>
>> Now, if I have two of these sentences in one rule, it obviously won't
>> work as the variable `$a` occurs twice. So I wanted to improve the
>> rule to make the variable, well, variable:
>>
>> [when]The field {field} in the module {module} contains value
>> {value} as {a}={a} : {module} ( {field} != null)
>>
>>   String( this.equalsIgnoreCase("{value}") ) from {a}.{field}
>>
>> This doesn't work, I can't use the part `{a}.`, that breaks.
>>
>> So, my questions are: Is there either a way to rewrite the rules or a
>> way to allow the `{variable}.` notation to work? Alternatively, is
>> there a `contains` operator which works case insensitive?
>>
>> Thanks in advance
>>
>> Dominik
>>
>>
>> ___
>> 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] how to declare an identifier and use it?

2012-06-13 Thread vysrinivas
Hi,


Requirement:

i have a function which will return a value. Say for example String
getInfo().

In header level, i have a tag called as TType. possible values in this tag
are Online/offline.

In line level, i have a validation which should be executed based on TType.

if i get TType = online, line level validation has to be executed.

if i get TType = offline, then line level validation has to be skipped. No
validation should happen.


Solution:

I have to call getInfo() function in linelevel   so that it
will return me the TType value.

based on TType, validation will happen / can be skipped.


Issue:

As i am declaring given below.




THeaderType



TLineType



getQType(TReqHeader) != null
|| !getInfo(TReqHeader).equals("Online")




getOffType(TReqLine).equals("Local")



As show above, i am having two java conditions.

1. it will verify whether TType is online / offline.
2. it will verify whether offtype is Local or not

when i test with valid data, it never perform above validations. it just
skip both the validations irrespective whether TType is online/ offline.



Suggestion:

Can anyone let me know what might be the issue?

1. Is it that i am having both header and line program calls in one rule?

2. is it that i cannot use header value in line level validation?



work around:

is there any work around as given below

can i declare a variable/identifier in line and invoke the method and have
the return value in the declared identifier?


   
getInfo(TReqHeader)



so that i can use this TType within the line .



Please verify and suggest possible way to fix this issue.

let me know if you need any other info. 

--
View this message in context: 
http://drools.46999.n3.nabble.com/how-to-declare-an-identifier-and-use-it-tp4017888.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] Using 'from {x}.field' in DSL

2012-06-13 Thread Sandjaja, Dominik
Hello Wolfgang, hello everybody,

Nice one, thanks for the idea! This one works for now, but is there a way to 
automatically assign random variable names to the RHS of the DSL? So the user 
won't have to explicitly set a variable in the DSL which is only needed for 
internal purposes.

Thanks
Dominik

-Ursprüngliche Nachricht-
Von: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Wolfgang Laun
Gesendet: Dienstag, 12. Juni 2012 19:46
An: Rules Users List
Cc: Edson Tirelli
Betreff: Re: [rules-users] Using 'from {x}.field' in DSL

There is a bug in the DSL parser: after '=', a couple of variable references 
merely separated by a period isn't recognized.

As a workaround, use this:

[when][]The field {field} in the module {module} contains value {value} as 
{abc} =
 {abc}x : {module} ( {field} != null) String(
this.equalsIgnoreCase("{value}") ) from {abc}x.{field}

-W


On 12/06/2012, Sandjaja, Dominik  wrote:
> There is no expanded DRL. If I take that line into the DSL, I can't 
> even validate the DSL and if I have the line in it, I can't select any 
> DSL statements for rules in Guvnor.
>
>
>
> BTW, I am using Drools and Guvnor 5.4.0.
>
>
>
> Von: rules-users-boun...@lists.jboss.org
> [mailto:rules-users-boun...@lists.jboss.org] Im Auftrag von Wolfgang 
> Laun
> Gesendet: Dienstag, 12. Juni 2012 17:31
> An: Rules Users List
> Betreff: Re: [rules-users] Using 'from {x}.field' in DSL
>
>
>
> Have you checked the expanded DRL? What does this line look like?
>
> -W
>
> On 12 June 2012 17:06, Sandjaja, Dominik 
> 
> wrote:
>
> I have the following Drools DSL "sentence":
>
> [when]The field {field} in the module {module} contains value 
> {value}=$a : {module} ( {field} != null)
>
>   String( this.equalsIgnoreCase("{value}") ) from $a.{field}
>
> where the `field` is a `Set` of Strings.
>
> Now, if I have two of these sentences in one rule, it obviously won't 
> work as the variable `$a` occurs twice. So I wanted to improve the 
> rule to make the variable, well, variable:
>
> [when]The field {field} in the module {module} contains value 
> {value} as {a}={a} : {module} ( {field} != null)
>
>   String( this.equalsIgnoreCase("{value}") ) from {a}.{field}
>
> This doesn't work, I can't use the part `{a}.`, that breaks.
>
> So, my questions are: Is there either a way to rewrite the rules or a 
> way to allow the `{variable}.` notation to work? Alternatively, is 
> there a `contains` operator which works case insensitive?
>
> Thanks in advance
>
> Dominik
>
>
> ___
> 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] How to read DRL files not in resource classpath?

2012-06-13 Thread Charles
I am using Drools Planner.
Is there any way to separate rules.drl from program.jar.

Project
- program.jar
- rules.drl

Currently, Drools Planner only search for .drl file within resource
classpath.

--
View this message in context: 
http://drools.46999.n3.nabble.com/How-to-read-DRL-files-not-in-resource-classpath-tp4017885.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