[jboss-jira] [JBoss JIRA] (DROOLS-120) Add ability to trait a map
Davide Sottara (JIRA)
jira-events at lists.jboss.org
Sun Apr 28 00:23:53 EDT 2013
[ https://issues.jboss.org/browse/DROOLS-120?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Davide Sottara moved JBRULES-3701 to DROOLS-120:
------------------------------------------------
Project: Drools (was: JBRULES)
Key: DROOLS-120 (was: JBRULES-3701)
Workflow: GIT Pull Request workflow (was: jira)
Affects Version/s: 5.5.0.Final
(was: 5.5.0.Final)
Component/s: (was: drools-core (expert))
> Add ability to trait a map
> --------------------------
>
> Key: DROOLS-120
> URL: https://issues.jboss.org/browse/DROOLS-120
> Project: Drools
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Affects Versions: 5.5.0.Final
> Reporter: Ming Fang
> Assignee: Davide Sottara
>
> Add ability to trait a Map as described by Mark Proctor here
> http://drools.46999.n3.nabble.com/rules-users-Maps-as-Object-in-Drools-td4019268.html
> <quote>
> //code below is illustrative of what is possible, if changes where mad for above idea.
> // Create interface
> Person
> @Trait
> String : name
> int : age
> end
> // Identify the Map instance, and wrap it with the Person interface.
> rule
> $m : Map[ this['name'] != null, this['age'] != null )
> then
> don( $m : Person.class );
> end
> // Now the map is identified in a type safe manner.
> rule
> Person( name == "darth", age == 150 )
> then
> ….
> end
> </quote>
--
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