[
https://issues.jboss.org/browse/DROOLS-4636?page=com.atlassian.jira.plugi...
]
Anna Dupliak updated DROOLS-4636:
---------------------------------
Description:
Update Scenario Cheatsheet for MVEL expression usage.
h3. Here are some topics that could be mentioned:
Expressions for Rule based scenarios for simple types
* Starts from "*#*"
* Runs for +properties+
* Runs for +duplicated+ properties
* Returns the +same+ type as property type in *GIVEN*
* Returns boolean in *EXPECTED*
* Receives rule processed value as a *parameter* in *EXPECTED* via keyword
"*actualValue*"
* Applies java.util.Objects.equals(actualValue, expression result) on the expression
result if the *EXPECTED* value not a *boolean*
* Could run any of java function for the project
* Exports and imports as any other value
Limitation for GIVEN
1. Mvel expression results +not property same+ type - drives scenario +failure, error
reason and highlighted+
Use case:
User inputs 1/2 to Integer property
2.Mvel execution throws +exception+ - drives scenario execution +stopping, failure, error
alert+
Use case:
User inputs inexistent MVEL function in one of the properties
3.Mvel expression +exception stops+ expression +execution+ for all *EXPECT* colons
Use case:
User got one of the GIVEN fact expression excepted
4.Mvel +cannot be mixed+ with simple expressions in one cell
Use case:
For cell inputs :
{code:java}
[#4+4,68]
#actualvalue>1
{code}
was:
Update Scenario Cheatsheet for MVEL expression usage.
Here are some topics that could be mentioned:
Expressions for Rule based scenarios for simple types
Starts from "#"
Runs for properties
Runs for duplicated properties
Returns the same type as property type in GIVEN
Returns boolean in EXPECTED
Receives rule processed value as a parameter in EXPECTED via keyword
"actualValue"
Applies java.util.Objects.equals(actualValue, expression result) on the expression result
if the EXPECTED value not a boolean
Could run any of java function for the project
Exports and imports as any other value
Limitation for GIVEN
1. Mvel expression results not property same type - drives scenario failure, error reason
and highlighted
Use case:
User inputs 1/2 to Integer property
2.Mvel execution throws exception - drives scenario execution stopping, failure, error
alert
Use case:
User inputs inexistent MVEL function in one of the properties
3.Mvel expression exception stops expression execution for all EXPECT colons
Use case:
User got one of the GIVEN fact expression excepted
4.It cannot be mixed with simple expressions in one cell
Use case:
For cell inputs :
[#4+4,68]
#actualvalue>1
Git Pull Request:
https://github.com/kiegroup/drools/pull/2563#
Update Scenario Cheatsheet to mention MVEL
------------------------------------------
Key: DROOLS-4636
URL:
https://issues.jboss.org/browse/DROOLS-4636
Project: Drools
Issue Type: Task
Components: Scenario Simulation and Testing
Affects Versions: 7.27.0.Final
Reporter: Anna Dupliak
Assignee: Daniele Zonca
Priority: Minor
Labels: CustomerFocus
Update Scenario Cheatsheet for MVEL expression usage.
h3. Here are some topics that could be mentioned:
Expressions for Rule based scenarios for simple types
* Starts from "*#*"
* Runs for +properties+
* Runs for +duplicated+ properties
* Returns the +same+ type as property type in *GIVEN*
* Returns boolean in *EXPECTED*
* Receives rule processed value as a *parameter* in *EXPECTED* via keyword
"*actualValue*"
* Applies java.util.Objects.equals(actualValue, expression result) on the expression
result if the *EXPECTED* value not a *boolean*
* Could run any of java function for the project
* Exports and imports as any other value
Limitation for GIVEN
1. Mvel expression results +not property same+ type - drives scenario +failure, error
reason and highlighted+
Use case:
User inputs 1/2 to Integer property
2.Mvel execution throws +exception+ - drives scenario execution +stopping, failure, error
alert+
Use case:
User inputs inexistent MVEL function in one of the properties
3.Mvel expression +exception stops+ expression +execution+ for all *EXPECT* colons
Use case:
User got one of the GIVEN fact expression excepted
4.Mvel +cannot be mixed+ with simple expressions in one cell
Use case:
For cell inputs :
{code:java}
[#4+4,68]
#actualvalue>1
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)