MVEL expression

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

MVEL expression

Femke De Backere
Hi,

The following expression keeps returning the error [112,32]: [ERR 103] Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: MVEL expression

Edson Tirelli-3

   Left side of a constraint should always be a field name... no expression allowed. Either move the expression to the right side or use eval.

Patient( sedation.ultiva > ( 0.1 - 0.02 ) )

   Or even better:

Patient(sedation.ultiva > 0.08)

   []s
   Edson

2009/3/16 Femke De Backere <[hidden email]>
Hi,

The following expression keeps returning the error [112,32]: [ERR 103] Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke

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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: MVEL expression

Femke De Backere
Thx!

Do you know where I could find a tutorial of MVEL in Drools, because I looked at some MVEL tutorials yesterday and I didn't find the solution...

2009/3/17 Edson Tirelli <[hidden email]>

   Left side of a constraint should always be a field name... no expression allowed. Either move the expression to the right side or use eval.

Patient( sedation.ultiva > ( 0.1 - 0.02 ) )

   Or even better:

Patient(sedation.ultiva > 0.08)

   []s
   Edson

2009/3/16 Femke De Backere <[hidden email]>
Hi,

The following expression keeps returning the error [112,32]: [ERR 103] Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke

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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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
Reply | Threaded
Open this post in threaded view
|

Re: MVEL expression

Edson Tirelli-3

   Although Drools makes extensive usage of MVEL, it is always embedded in the DRL language. So, it is Drools that defines that a field constraint is always a field accessor in the left with one or more restrictions in the right.

   We need to find a way to make the Drools x MVEL relationship more clear because it is not the first time this slight confusion is made. 

   Anyway, docs are being updated, but take a look at the Pattern documentation (item 7.8.2.1):

https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch07.html#RuleLanguage-ConditionalElements

   []s
   Edson



2009/3/17 Femke De Backere <[hidden email]>
Thx!

Do you know where I could find a tutorial of MVEL in Drools, because I looked at some MVEL tutorials yesterday and I didn't find the solution...

2009/3/17 Edson Tirelli <[hidden email]>


   Left side of a constraint should always be a field name... no expression allowed. Either move the expression to the right side or use eval.

Patient( sedation.ultiva > ( 0.1 - 0.02 ) )

   Or even better:

Patient(sedation.ultiva > 0.08)

   []s
   Edson

2009/3/16 Femke De Backere <[hidden email]>
Hi,

The following expression keeps returning the error [112,32]: [ERR 103] Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke

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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: MVEL expression

Femke De Backere
Another question ;), 

Can I perform a cast in MVEL? eg. Patient((ShortSedation) sedation.sedation24 == false)

Thx

Op 17-mrt-09, om 19:27 heeft Edson Tirelli het volgende geschreven:


   Although Drools makes extensive usage of MVEL, it is always embedded in the DRL language. So, it is Drools that defines that a field constraint is always a field accessor in the left with one or more restrictions in the right.

   We need to find a way to make the Drools x MVEL relationship more clear because it is not the first time this slight confusion is made. 

   Anyway, docs are being updated, but take a look at the Pattern documentation (item 7.8.2.1):

https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch07.html#RuleLanguage-ConditionalElements

   []s
   Edson



2009/3/17 Femke De Backere <[hidden email]>
Thx!

Do you know where I could find a tutorial of MVEL in Drools, because I looked at some MVEL tutorials yesterday and I didn't find the solution...

2009/3/17 Edson Tirelli <[hidden email]>


   Left side of a constraint should always be a field name... no expression allowed. Either move the expression to the right side or use eval.

Patient( sedation.ultiva > ( 0.1 - 0.02 ) )

   Or even better:

Patient(sedation.ultiva > 0.08)

   []s
   Edson

2009/3/16 Femke De Backere <[hidden email]>
Hi,

The following expression keeps returning the error [112,32]: [ERR 103] Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke

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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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
Reply | Threaded
Open this post in threaded view
|

Re: MVEL expression

Mark Proctor
Femke De Backere wrote:
Another question ;), 

Can I perform a cast in MVEL? eg. Patient((ShortSedation) sedation.sedation24 == false)
the LHS "when" is not MVEL, it's DRL Pattern language, it's just that some things we translate to MVEL for execution. Our pattner language does not support casting, no. However MVEL itself does support casting, and you can do that on a RHS "then" which is full MVEL.

Mark

Thx

Op 17-mrt-09, om 19:27 heeft Edson Tirelli het volgende geschreven:


   Although Drools makes extensive usage of MVEL, it is always embedded in the DRL language. So, it is Drools that defines that a field constraint is always a field accessor in the left with one or more restrictions in the right.

   We need to find a way to make the Drools x MVEL relationship more clear because it is not the first time this slight confusion is made. 

   Anyway, docs are being updated, but take a look at the Pattern documentation (item 7.8.2.1):

https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch07.html#RuleLanguage-ConditionalElements

   []s
   Edson



2009/3/17 Femke De Backere <[hidden email]>
Thx!

Do you know where I could find a tutorial of MVEL in Drools, because I looked at some MVEL tutorials yesterday and I didn't find the solution...

2009/3/17 Edson Tirelli <[hidden email]>


   Left side of a constraint should always be a field name... no expression allowed. Either move the expression to the right side or use eval.

Patient( sedation.ultiva > ( 0.1 - 0.02 ) )

   Or even better:

Patient(sedation.ultiva > 0.08)

   []s
   Edson

2009/3/16 Femke De Backere <[hidden email]>
Hi,

The following expression keeps returning the error [112,32]: [ERR 103] Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke

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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: MVEL expression

Mark Proctor
Mark Proctor wrote:
Femke De Backere wrote:
Another question ;), 

Can I perform a cast in MVEL? eg. Patient((ShortSedation) sedation.sedation24 == false)
the LHS "when" is not MVEL, it's DRL Pattern language, it's just that some things we translate to MVEL for execution. Our pattner language does not support casting, no. However MVEL itself does support casting, and you can do that on a RHS "then" which is full MVEL.
Sorry that's not quite true, if you use an EVAL thats pure MVEL a cast should work inside of that, as evals are like black boxes to the rule engine and they are executed directly by java or mvel depending on the dialect you chose.

Mark

Mark

Thx

Op 17-mrt-09, om 19:27 heeft Edson Tirelli het volgende geschreven:


   Although Drools makes extensive usage of MVEL, it is always embedded in the DRL language. So, it is Drools that defines that a field constraint is always a field accessor in the left with one or more restrictions in the right.

   We need to find a way to make the Drools x MVEL relationship more clear because it is not the first time this slight confusion is made. 

   Anyway, docs are being updated, but take a look at the Pattern documentation (item 7.8.2.1):

https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/trunk/target/docs/drools-expert/html/ch07.html#RuleLanguage-ConditionalElements

   []s
   Edson



2009/3/17 Femke De Backere <[hidden email]>
Thx!

Do you know where I could find a tutorial of MVEL in Drools, because I looked at some MVEL tutorials yesterday and I didn't find the solution...

2009/3/17 Edson Tirelli <[hidden email]>


   Left side of a constraint should always be a field name... no expression allowed. Either move the expression to the right side or use eval.

Patient( sedation.ultiva > ( 0.1 - 0.02 ) )

   Or even better:

Patient(sedation.ultiva > 0.08)

   []s
   Edson

2009/3/16 Femke De Backere <[hidden email]>
Hi,

The following expression keeps returning the error [112,32]: [ERR 103] Line 112:32 no viable alternative at input '+' in rule "RuleFlow-Split-masterproef.ruleflows.shortsedation-18-22" in pattern Patient:
Patient(sedation.ultiva+0.02 > 0.1)
with sedation.ultiva returning a double
What am I doing wrong?
Thx,
Femke

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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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




--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.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



_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Formula and Predicate example using a condition for Guvnor

Ravi Krishnamurthy
Hello:
Is there any examples available using the Formula and Predicate Calculation type for Guvnor.

Thanks
Ravi




_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: Formula and Predicate example using a condition for Guvnor

Michael Neale
no there isn't at the moment. Really it just means that the value
someone enters must be a calculation.

eg: amount * 2

Would like to at some point add in a function pallette of common
things people do that can popup and provide assistance (like open
office has for its formulas) - including all built in ones etc (will
be a bit of work though). Essentially it is a little widget that would
show all the things you can do and by clicking on one it would paste
in the formula template  (always looking for someone so inclined to
work on that).



2009/3/18 Ravi Krishnamurthy <[hidden email]>:

> Hello:
> Is there any examples available using the Formula and Predicate Calculation
> type for Guvnor.
>
> Thanks
> Ravi
>
>
>
>
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>



--
Michael D Neale
home: www.michaelneale.net
blog: michaelneale.blogspot.com
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: MVEL expression

kapokfly
In reply to this post by Mark Proctor
"the LHS "when" is not MVEL, it's DRL Pattern language, it's just that some things we translate to MVEL for execution. Our pattner language does not support casting, no. However MVEL itself does support casting, and you can do that on a RHS "then" which is full MVEL.
Sorry that's not quite true, if you use an EVAL thats pure MVEL a cast should work inside of that, as evals are like black boxes to the rule engine and they are executed directly by java or mvel depending on the dialect you chose."


Finally I found something 'official' :--) It was confusing me why Drools does not support transparent type casting while MVEL has a very good support on that, now it explains...

Hi Mark,
Is this still true with the latest Drools 5.3? BTW, great work on MVEL, we like it :-)


Ivan, your Panda, forever