[jboss-jira] [JBoss JIRA] (JBRULES-2866) Support for Metadata in Decision Tables

Jason Mihalick (JIRA) jira-events at lists.jboss.org
Tue Apr 17 12:25:19 EDT 2012


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

Jason Mihalick edited comment on JBRULES-2866 at 4/17/12 12:25 PM:
-------------------------------------------------------------------

Thanks, I have reviewed the documentation and I've been able to get the metadata to work in my decision table.  But, it took a little trial and error for me to figure out how to use multiple @metadata_key( metadata_value ) pairs.  I first tried comma separating, like this:

{code}
id( $1 ),
type( $2 )
{code}

but only the first metadata_key gets picked up and the resulting compiled rule has this:

{code}
@id( my_first_metadata_value ),
type( my_second_metadata_value)
{code}

Notice the absence of the '@' on the second metadata_key.

I then tried this:
{code}
id( $1 ),
@type( $2 )
{code}

and I got this output in the compiled decision table:
{code}
@id( my_first_metadata_value ),
@type( my_second_metadata_value)
{code}

Close, but not quite there.  I then eliminated the comma:
{code}
id( $1 )
@type( $2 )
{code}

and I got the output below which successfully compiles:
{code}
@id( my_first_metadata_value )
@type( my_second_metadata_value)
{code}

I also see that you can have multiple *METADATA* columns, so you could also have one metadata_key in each column.
                
      was (Author: jrmihalick):
    Thanks, I have reviewed the documentation and I've been able to get the metadata to work in my decision table.  But, it took a little trial and error for me to figure out how to use multiple @metadata_key( metadata_value ) pairs.  I first tried comma separating, like this:

{code}
id( $1 ),
type( $2 )
{code}

but only the first metadata_key gets picked up and the resulting compiled rule has this:

{code}
@id( my_first_metadata_value ),
type( my_second_metadata_value)
{code}

Notice the absence of the '@' on the second metadata_key.

I then tried this:
{code}
id( $1 ),
@type( $2 )
{code}

and I got this output in the compiled decision table:
{code}
@id( my_first_metadata_value ),
@type( my_second_metadata_value)
{code}

Close, but not quite there.  I then eliminated the comma:
{code}
id( $1 )
@type( $2 )
{code}

and I got the output below which successfully compiles:
{code}
@id( my_first_metadata_value )
@type( my_second_metadata_value)
{code}

                  
> Support for Metadata in Decision Tables
> ---------------------------------------
>
>                 Key: JBRULES-2866
>                 URL: https://issues.jboss.org/browse/JBRULES-2866
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-decisiontables
>    Affects Versions: 5.1.1.FINAL
>         Environment: All
>            Reporter: Jason Mihalick
>            Assignee: Tihomir Surdilovic
>             Fix For: 5.2.0.Final
>
>
> Please add support for Metadata annotations in decision tables.  Discussion thread here: http://drools-java-rules-engine.46999.n3.nabble.com/Need-help-with-Decision-Table-Conditions-td2195003.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list