When I author rules do the objects have to be beans? The reason I ask is that I have a bunch of JAXB (version 1.0) objects that get automaticly generated. I would like to use the interfeces that it generates for matching LHS condition. However interfaces that gets generated don't have 'properties' that I can use for rule authoring. At the moment in order to get the rule working I have to dig deep into the auto-generated classes to fine the concret class and get the property. This is not ideal as I guess the concret classes that get generated are 'hidden' for a reason (i.e. subject to change)

For example this is my rule (a rule that gets the RNA of a DNA sequence):
-----------------------------------------------------------------
package uk.ac.ebi.submission.rules

#This is a jaxb generated interface
import uk.ac.ebi.submission.emblentry.bind.EntryType.FeatureType;


rule "get RNA"
        when
                fet : FeatureType( getName() == "mRNA" )
        then
                System.out.println("feat name " + fet.getName());
                
end

-----------------------------------------------------------------

This don't work ofcource as 'fet : FeatureType( getName() == "mRNA" )' is not valid syntax.
In order to get this rule to work I have to use the concret class i.e. :

---------------------------------------------------------------------------------
package uk.ac.ebi.submission.rules

#Concret class
import uk.ac.ebi.submission.emblentry.bind.impl.EntryTypeImpl.FeatureTypeImpl;

rule "get RNA"
        when
                fet : FeatureTypeImpl( name == "mRNA" )
        then
                System.out.println("feat name " + fet.getName());
                
end
---------------------------------------------------------------------------------

Is there a way around this? Thanks for any insight.


--
Charlie

Reply via email to