[jboss-jira] [JBoss JIRA] (DROOLS-1729) Unable to load rule with global variables via kiescanner.

Pedro Almeida (JIRA) issues at jboss.org
Fri Sep 15 11:26:00 EDT 2017


     [ https://issues.jboss.org/browse/DROOLS-1729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pedro Almeida updated DROOLS-1729:
----------------------------------
    Description: 
I have a master drl that has global *variables declaration* as well as *class role declarations*. Other drl files depend on those declarations. 
Build is successful and I'm able to use the engine as intended. The thing is when I use kiescanner to unload a rule and load it back, I get compilation errors that make it look like the master drl is not being accounted.

*Errors: *
1) "A Sliding Window can only be assigned to types declared with @role( event )
[Actually my object type is declared with role event on the master drl]

2) "helper cannot be resolved"
[helper being my global variable, an instance of a class]

*Rule:*
package rules;
import model.Car;

global Boolean isTest;

rule "Red Car"
    when
        Car (color=="Red") over window:time(2h);
    then
        System.out.println("*** Red car");
        System.out.println("*** " + isTest);
end





  was:
I have a master drl that has global *variables declaration* as well as *class role declarations*. Other drl files depend on those declarations. 
Build is successful and I'm able to use the engine as intended. The thing is when I use kiescanner to unload a rule and load it back, I get compilation errors that make it look like the master drl is not being accounted.

Errors: 

1) "A Sliding Window can only be assigned to types declared with @role( event )
[Actually my object type is declared with role event on the master drl]

2) "helper cannot be resolved"
[helper being my global variable, an instance of a class]

Rule:
package rules;
import model.Car;

global Boolean isTest;

rule "Red Car"
    when
        Car (color=="Red") over window:time(2h);
    then
        System.out.println("*** Red car");
        System.out.println("*** " + isTest);
end







> Unable to load rule with global variables via kiescanner.
> ---------------------------------------------------------
>
>                 Key: DROOLS-1729
>                 URL: https://issues.jboss.org/browse/DROOLS-1729
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 6.5.0.Final
>            Reporter: Pedro Almeida
>            Assignee: Edson Tirelli
>            Priority: Blocker
>
> I have a master drl that has global *variables declaration* as well as *class role declarations*. Other drl files depend on those declarations. 
> Build is successful and I'm able to use the engine as intended. The thing is when I use kiescanner to unload a rule and load it back, I get compilation errors that make it look like the master drl is not being accounted.
> *Errors: *
> 1) "A Sliding Window can only be assigned to types declared with @role( event )
> [Actually my object type is declared with role event on the master drl]
> 2) "helper cannot be resolved"
> [helper being my global variable, an instance of a class]
> *Rule:*
> package rules;
> import model.Car;
> global Boolean isTest;
> rule "Red Car"
>     when
>         Car (color=="Red") over window:time(2h);
>     then
>         System.out.println("*** Red car");
>         System.out.println("*** " + isTest);
> end



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list