[jboss-jira] [JBoss JIRA] (DROOLS-136) type casting via the # symbol hangs drools

Martin Minka (JIRA) jira-events at lists.jboss.org
Mon May 13 04:48:06 EDT 2013


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

Martin Minka commented on DROOLS-136:
-------------------------------------

the attached file should hang Drools 5.5.0 and Drools 6.0.0beta2

this is the rule which hangs on DRL loading:

{code} 
rule "hangs Drools: calculate totalPrice per item"
salience -10
no-loop
dialect "java"
when
    $q:Message(id=="item", answered==true,
        $v:value#DataItemPrice
    )
then
	System.out.println("setting totalPrice on item: " + ((DataItemPrice)$v).getName());
    ((DataItemPrice)$q.getValue()).setTotalPrice(
        ((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice()
    );
    update($q);
end
{code}

there is also commented out working version of the same rule:

{code}
rule "working: calculate totalPrice per item"
salience -10
no-loop
dialect "java"
when
    $q:Message(id=="item", answered==true,
        value instanceof DataItemPrice, $v:value
    )
then
	System.out.println("setting totalPrice on item: " + ((DataItemPrice)$v).getName());
    ((DataItemPrice)$q.getValue()).setTotalPrice(
        ((DataItemPrice)$v).getQty()*((DataItemPrice)$v).getUnitPrice()
    );
    update($q);
end
{code}
                
> type casting via the # symbol hangs drools
> ------------------------------------------
>
>                 Key: DROOLS-136
>                 URL: https://issues.jboss.org/browse/DROOLS-136
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 5.5.0.Final, 6.0.0.Beta2
>            Reporter: Martin Minka
>            Assignee: Mark Proctor
>         Attachments: src.zip
>
>
> when trying to assign type casted value to variable in when clausule Drools hangs without any message on rule load. It even hangs my Eclipse environment in build process.
> this will hang:
> $q:Message(id=="item", answered==true, $v:value#DataItemPrice)
> this will not hang:
>     $q:Message(id=="item", answered==true, value instanceof DataItemPrice, $v:value)
> Maybe it is not supported to type cast the property into variable in this way, but it should not hang the Drools engine.
> I will try to add full example.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list