[
https://jira.jboss.org/jira/browse/JBRULES-1702?page=com.atlassian.jira.p...
]
Michael Neale closed JBRULES-1702.
----------------------------------
Resolution: Done
OK shouldn't have any package or import statements in DT that is uploaded, however, I
now strip out the package statement, but leave the imports in if they are found - I think
that should work fine - please confirm.
BRMS: uploading a decision table breaks the package
---------------------------------------------------
Key: JBRULES-1702
URL:
https://jira.jboss.org/jira/browse/JBRULES-1702
Project: JBoss Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-brms
Affects Versions: 5.0.0.M1
Reporter: Jaroslaw Kijanowski
Assignee: Michael Neale
Fix For: 5.0.0.M2
Attachments: Sample.xls
I create a rule, then upload a decision table (see attached) and:
- if I compile the package it looks good, however it isn't, I cannot run a test
scenario for example, because I will get missing imports of facts from the first rule;
- if I create another rule, I won't be able to compile the package due to missing
imports;
I guess the reason for this is that the decision table adds its own import and package
statements in the middle of the rule file.
Here's the source of the package with one "regular" rule and one rule
coming from the decision table:
package myNewPAckage
import com.model.Person
import com.model.Alarm
import com.model.Message
rule "first"
dialect "mvel"
when
Alarm( )
then
Person fact0 = new Person();
fact0.setAge( 18 );
insert( fact0 );
end
package XLSRules;
#generated from Decision Table
import com.model.Message;
#From row number: 11
rule "HelloWorld_11"
when
m:Message(status == Message.HELLO)
then
System.out.println(m.getMessage());
m.setMessage("Goodbye cruel world");update(m);
m.setStatus(Message.GOODBYE);update(m);
end
#From row number: 12
rule "HelloWorld_12"
when
m:Message(status == Message.GOODBYE)
then
System.out.println(m.getMessage());
end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira