Hi Mark,
This is the rough template i have created to produce rules. I am able to
generate basic rules and able to write them .drl.
package @{package};
@foreach{importEntry : imports}
import @{importEntry};
@end{}
@foreach{importEntry : staticImports}
import static @{importEntry};
@end{}
rule "@{ruleName}"
dialect "@{dialectName}"
salience @{salienceValue}
enabled @{enableValue}
when
@foreach{modelObject : modelObjects} @{modelObject.referenceName} :
@{modelObject.referenceType} ( @foreach{ attribute : modelObject.attributes}
@{attribute.name} @{attribute.operator} "(a){attribute.value}" @end{} ) @end{}
then
@foreach{modelObject : modelObjects} @{modelObject.referenceName} :
@{modelObject.referenceType} ( @foreach{ attribute :
modelObject.thenAttributes} @{attribute.name} @{attribute.operator}
"(a){attribute.value}" @end{} ) @end{}
end
I am reading the generated rule through .drl into String. How can i able to
parse it so that it will give me object model which i passed to this
template?
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-generate-rule-statements-using-M...
Sent from the Drools: User forum mailing list archive at
Nabble.com.