[
https://issues.redhat.com/browse/DROOLS-5877?page=com.atlassian.jira.plug...
]
Luca Molteni updated DROOLS-5877:
---------------------------------
Description:
It seems like it's already supported in the consequence
[
https://github.com/kiegroup/drools/blob/6408b5e1caa1e5c5fe94e45f82e1bedfb...]
{code:java}
@Test
public void prova() {
final String str =
"global java.util.List list\n" +
"import " + Person.class.getCanonicalName() + ";" +
"rule R when\n" +
"$p1 : Person(age >= 18B)" +
"then\n" +
" System.out.println($p1);" +
"end\n";
KieSession ksession = getKieSession( str );
List<String> results = new ArrayList<>();
ksession.setGlobal("list", results);
ksession.insert( new Person( "Mark", 37 ) );
ksession.insert( new Person( "Edson", 35 ) );
ksession.insert( new Person( "Mario", 40 ) );
ksession.fireAllRules();
}{code}
was:
{code:java}
@Test
public void prova() {
final String str =
"global java.util.List list\n" +
"import " + Person.class.getCanonicalName() + ";" +
"rule R when\n" +
"$p1 : Person(age >= 18B)" +
"then\n" +
" System.out.println($p1);" +
"end\n";
KieSession ksession = getKieSession( str );
List<String> results = new ArrayList<>();
ksession.setGlobal("list", results);
ksession.insert( new Person( "Mark", 37 ) );
ksession.insert( new Person( "Edson", 35 ) );
ksession.insert( new Person( "Mario", 40 ) );
ksession.fireAllRules();
}{code}
Support MVEL BLiteral in the exec model
---------------------------------------
Key: DROOLS-5877
URL:
https://issues.redhat.com/browse/DROOLS-5877
Project: Drools
Issue Type: Bug
Components: executable model
Reporter: Luca Molteni
Assignee: Luca Molteni
Priority: Major
It seems like it's already supported in the consequence
[
https://github.com/kiegroup/drools/blob/6408b5e1caa1e5c5fe94e45f82e1bedfb...]
{code:java}
@Test
public void prova() {
final String str =
"global java.util.List list\n" +
"import " + Person.class.getCanonicalName() + ";" +
"rule R when\n" +
"$p1 : Person(age >= 18B)" +
"then\n" +
" System.out.println($p1);" +
"end\n";
KieSession ksession = getKieSession( str );
List<String> results = new ArrayList<>();
ksession.setGlobal("list", results);
ksession.insert( new Person( "Mark", 37 ) );
ksession.insert( new Person( "Edson", 35 ) );
ksession.insert( new Person( "Mario", 40 ) );
ksession.fireAllRules();
}{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)