[jboss-jira] [JBoss JIRA] (DROOLS-2438) Drools template : Multiple rows from database map to multiple conditions within the when block of a a single rule

Edson Tirelli (JIRA) issues at jboss.org
Mon Apr 2 20:33:00 EDT 2018


    [ https://issues.jboss.org/browse/DROOLS-2438?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13554726#comment-13554726 ] 

Edson Tirelli commented on DROOLS-2438:
---------------------------------------

[~rahulfedex] , the out of the box templates are not designed to work that way.

My suggestion would be for you to use a regular template language (MVEL, FreeMarker, Velocity, etc) to generate the DRL. 

Also, you will get a faster answer to this kind of questions from the customer support (if you have a Red Hat subscription) or from the project mailing list otherwise.


> Drools template : Multiple rows from database  map to multiple conditions within the when block of a  a single rule
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-2438
>                 URL: https://issues.jboss.org/browse/DROOLS-2438
>             Project: Drools
>          Issue Type: Enhancement
>          Components: core engine
>    Affects Versions: 7.6.0.Final
>            Reporter: Rahul Vanimisetty
>            Assignee: Mario Fusco
>              Labels: task
>
> In a drool template, if i am loading rules from a database, then as per my understanding each row in the database table represents a rule. So a drool template will generate a drl file in the following way : 
> rule 1
> when 
>       condition(first row of db)
>       action
> rule 2
>       condition(2cd row of db)
> then
>        action
> etc.
> My requirement is to have a dynamic drl generated in the following way :
> rule 1
>  when
>        condition 1(1st row of db)
>        condition 2 (2cd row of db)
>        condition 3 (3rd row of db)
>        etc
> then
>        action
> end
> Please suggest a way to do this.



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list