Package org.drools.definition.type

Examples of org.drools.definition.type.FactField


        //Get the Fact Type for org.drools.EventA
        FactType factType = ((KnowledgePackageImp)kbuilder.getKnowledgePackages().iterator().next()).pkg.getFactType("org.drools.EventA");
        Assert.assertNotNull(factType);

        //'name' field must still be there
        FactField field = factType.getField("name");
        Assert.assertNotNull(field);

        //'duration' field must still be there
        field = factType.getField("duration");
        Assert.assertNotNull(field);
View Full Code Here


        //Get the Fact Type for org.drools.EventA
        FactType factType = ((KnowledgePackageImp)kbuilder.getKnowledgePackages().iterator().next()).pkg.getFactType("org.drools.EventA");
        Assert.assertNotNull(factType);

        //'name' field must still be there
        FactField field = factType.getField("name");
        Assert.assertNotNull(field);

        //'duration' field must still be there
        field = factType.getField("duration");
        Assert.assertNotNull(field);
View Full Code Here

        //each of the fields in the old definition that are also present in the
        //new definition must have the same type. If not -> Incompatible
        boolean allFieldsInOldDeclarationAreStillPresent = true;
        for (FactField oldFactField : oldFields) {
            FactField newFactField = newFieldsMap.get(oldFactField.getName());

            if (newFactField != null){
                //we can't use newFactField.getType() since it throws a NPE at this point.
                String newFactType = ((FieldDefinition)newFactField).getTypeName();

                if (!newFactType.equals(oldFactField.getType().getCanonicalName())){
                    throw new IncompatibleClassChangeError("Type Declaration "+newDeclaration.getTypeName()+"."+newFactField.getName()+" has a different"
                        + " type that its previous definition: "+newFactType
                        +" != "+oldFactField.getType().getCanonicalName());
                }
            }else{
                allFieldsInOldDeclarationAreStillPresent = false;
View Full Code Here

        //Get the Fact Type for org.drools.EventA
        FactType factType = ((KnowledgePackageImp)kbuilder.getKnowledgePackages().iterator().next()).pkg.getFactType("org.drools.EventA");
        Assert.assertNotNull(factType);

        //'name' field must still be there
        FactField field = factType.getField("name");
        Assert.assertNotNull(field);

        //'duration' field must still be there
        field = factType.getField("duration");
        Assert.assertNotNull(field);
View Full Code Here

        //Get the Fact Type for org.drools.EventA
        FactType factType = ((KnowledgePackageImp)kbuilder.getKnowledgePackages().iterator().next()).pkg.getFactType("org.drools.EventA");
        Assert.assertNotNull(factType);

        //'name' field must still be there
        FactField field = factType.getField("name");
        Assert.assertNotNull(field);

        //'duration' field must still be there
        field = factType.getField("duration");
        Assert.assertNotNull(field);
View Full Code Here

        assertEquals( String.class, ann.getPropertyType( "value" ) );

        assertEquals( 2, bean.getMetaData().size() );
        assertEquals( "event", bean.getMetaData().get( "role" ) );

        FactField field = bean.getField( "name" );
        assertNotNull( field );
        assertEquals( 1, field.getFieldAnnotations().size() );
        Annotation fnn = field.getFieldAnnotations().get( 0 );

        assertEquals( "org.drools.compiler.TypeDeclarationTest$FieldAnnotation", fnn.getName() );
        assertEquals( "fld", fnn.getPropertyValue( "prop" ) );
        assertEquals( String.class, fnn.getPropertyType( "prop" ) );

        assertEquals( 1, field.getMetaData().size() );
        assertTrue( field.getMetaData().containsKey( "key" ) );

    }
View Full Code Here

        //each of the fields in the old definition that are also present in the
        //new definition must have the same type. If not -> Incompatible
        boolean allFieldsInOldDeclarationAreStillPresent = true;
        for (FactField oldFactField : oldFields) {
            FactField newFactField = newFieldsMap.get(oldFactField.getName());

            if (newFactField != null){
                //we can't use newFactField.getType() since it throws a NPE at this point.
                String newFactType = ((FieldDefinition)newFactField).getTypeName();

                if (!newFactType.equals(oldFactField.getType().getCanonicalName())){
                    throw new IncompatibleClassChangeError("Type Declaration "+newDeclaration.getTypeName()+"."+newFactField.getName()+" has a different"
                        + " type that its previous definition: "+newFactType
                        +" != "+oldFactField.getType().getCanonicalName());
                }
            }else{
                allFieldsInOldDeclarationAreStillPresent = false;
View Full Code Here

        //each of the fields in the old definition that are also present in the
        //new definition must have the same type. If not -> Incompatible
        boolean allFieldsInOldDeclarationAreStillPresent = true;
        for (FactField oldFactField : oldFields) {
            FactField newFactField = newFieldsMap.get(oldFactField.getName());

            if (newFactField != null){
                //we can't use newFactField.getType() since it throws a NPE at this point.
                String newFactType = ((FieldDefinition)newFactField).getTypeName();

                if (!newFactType.equals(oldFactField.getType().getCanonicalName())){
                    throw new IncompatibleClassChangeError("Type Declaration "+newDeclaration.getTypeName()+"."+newFactField.getName()+" has a different"
                        + " type that its previous definition: "+newFactType
                        +" != "+oldFactField.getType().getCanonicalName());
                }
            }else{
                allFieldsInOldDeclarationAreStillPresent = false;
View Full Code Here

        //each of the fields in the old definition that are also present in the
        //new definition must have the same type. If not -> Incompatible
        boolean allFieldsInOldDeclarationAreStillPresent = true;
        for (FactField oldFactField : oldFields) {
            FactField newFactField = newFieldsMap.get(oldFactField.getName());

            if (newFactField != null){
                //we can't use newFactField.getType() since it throws a NPE at this point.
                String newFactType = ((FieldDefinition)newFactField).getTypeName();

                if (!newFactType.equals(oldFactField.getType().getCanonicalName())){
                    throw new IncompatibleClassChangeError("Type Declaration "+newDeclaration.getTypeName()+"."+newFactField.getName()+" has a different"
                        + " type that its previous definition: "+newFactType
                        +" != "+oldFactField.getType().getCanonicalName());
                }
            }else{
                allFieldsInOldDeclarationAreStillPresent = false;
View Full Code Here

        //each of the fields in the old definition that are also present in the
        //new definition must have the same type. If not -> Incompatible
        boolean allFieldsInOldDeclarationAreStillPresent = true;
        for (FactField oldFactField : oldFields) {
            FactField newFactField = newFieldsMap.get(oldFactField.getName());

            if (newFactField != null){
                //we can't use newFactField.getType() since it throws a NPE at this point.
                String newFactType = ((FieldDefinition)newFactField).getTypeName();

                if (!newFactType.equals(oldFactField.getType().getCanonicalName())){
                    throw new IncompatibleClassChangeError("Type Declaration "+newDeclaration.getTypeName()+"."+newFactField.getName()+" has a different"
                        + " type that its previous definition: "+newFactType
                        +" != "+oldFactField.getType().getCanonicalName());
                }
            }else{
                allFieldsInOldDeclarationAreStillPresent = false;
View Full Code Here

TOP

Related Classes of org.drools.definition.type.FactField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.