Package org.drools.workbench.models.guided.dtree.shared.model.nodes.impl

Examples of org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionRetractNodeImpl


            final ActionRetractFact arf = (ActionRetractFact) a;
            final String binding = arf.getVariableName();
            for ( TypeNode tn : types ) {
                if ( tn.isBound() ) {
                    if ( tn.getBinding().equals( binding ) ) {
                        final ActionRetractNode arn = new ActionRetractNodeImpl( tn );
                        nodes.add( arn );
                        return nodes;
                    }
                }
            }
View Full Code Here


        final TypeNode type = new TypeNodeImpl( "Person" );
        type.setBinding( "$p" );
        model.setRoot( type );

        final ActionRetractNode action = new ActionRetractNodeImpl( type );
        type.addChild( action );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
        assertEqualsIgnoreWhitespace( expected,
                                      drl );
View Full Code Here

                                                          "name" );
        c1.setBinding( "$n" );
        model.setRoot( type );
        type.addChild( c1 );

        final ActionRetractNode action = new ActionRetractNodeImpl( type );
        c1.addChild( action );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
        assertEqualsIgnoreWhitespace( expected,
                                      drl );
View Full Code Here

        action1.setModify( true );
        action1.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                                new IntegerValue( 25 ) ) );
        type.addChild( action1 );

        final ActionRetractNode action2 = new ActionRetractNodeImpl( type );
        action1.addChild( action2 );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
        assertEqualsIgnoreWhitespace( expected,
                                      drl );
View Full Code Here

        action1.setModify( false );
        action1.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                                new IntegerValue( 25 ) ) );
        type.addChild( action1 );

        final ActionRetractNode action2 = new ActionRetractNodeImpl( type );
        action1.addChild( action2 );

        final String drl = GuidedDecisionTreeDRLPersistence.getInstance().marshal( model );
        assertEqualsIgnoreWhitespace( expected,
                                      drl );
View Full Code Here

        final TypeNode type = new TypeNodeImpl( "Person" );
        type.setBinding( "$p" );
        expected.setRoot( type );

        final ActionRetractNode action = new ActionRetractNodeImpl( type );
        type.addChild( action );

        addModelField( "Person",
                       "this",
                       "Person",
                       DataType.TYPE_THIS );
        addModelField( "Person",
                       "name",
                       String.class.getName(),
                       DataType.TYPE_STRING );

        final GuidedDecisionTree model = GuidedDecisionTreeDRLPersistence.getInstance().unmarshal( drl,
                                                                                                   "test",
                                                                                                   dmo );

        assertNotNull( model );
        assertEquals( 0,
                      model.getParserErrors().size() );
        assertEquals( expected.getTreeName(),
                      model.getTreeName() );

        assertNotNull( model.getRoot() );
        assertEquals( type.getClassName(),
                      model.getRoot().getClassName() );
        assertTrue( model.getRoot().isBound() );
        assertEquals( type.getBinding(),
                      model.getRoot().getBinding() );

        assertEquals( 1,
                      model.getRoot().getChildren().size() );
        assertNotNull( model.getRoot().getChildren().get( 0 ) );
        assertTrue( model.getRoot().getChildren().get( 0 ) instanceof ActionRetractNode );

        final ActionRetractNode _a1 = (ActionRetractNode) model.getRoot().getChildren().get( 0 );

        assertEquals( action.getBoundNode().getBinding(),
                      _a1.getBoundNode().getBinding() );
    }
View Full Code Here

                                                          "name" );
        c1.setBinding( "$n" );
        expected.setRoot( type );
        type.addChild( c1 );

        final ActionRetractNode action = new ActionRetractNodeImpl( type );
        c1.addChild( action );

        addModelField( "Person",
                       "this",
                       "Person",
                       DataType.TYPE_THIS );
        addModelField( "Person",
                       "name",
                       String.class.getName(),
                       DataType.TYPE_STRING );

        final GuidedDecisionTree model = GuidedDecisionTreeDRLPersistence.getInstance().unmarshal( drl,
                                                                                                   "test",
                                                                                                   dmo );

        assertNotNull( model );
        assertEquals( 0,
                      model.getParserErrors().size() );
        assertEquals( expected.getTreeName(),
                      model.getTreeName() );

        assertNotNull( model.getRoot() );
        assertEquals( type.getClassName(),
                      model.getRoot().getClassName() );
        assertTrue( model.getRoot().isBound() );
        assertEquals( type.getBinding(),
                      model.getRoot().getBinding() );

        assertEquals( 1,
                      model.getRoot().getChildren().size() );
        assertNotNull( model.getRoot().getChildren().get( 0 ) );
        assertTrue( model.getRoot().getChildren().get( 0 ) instanceof ConstraintNode );

        final ConstraintNode _c1 = (ConstraintNode) model.getRoot().getChildren().get( 0 );

        assertEquals( c1.getClassName(),
                      _c1.getClassName() );
        assertEquals( c1.getFieldName(),
                      _c1.getFieldName() );
        assertEquals( c1.getOperator(),
                      _c1.getOperator() );
        assertNull( _c1.getValue() );

        assertEquals( 1,
                      _c1.getChildren().size() );
        assertNotNull( _c1.getChildren().get( 0 ) );
        assertTrue( _c1.getChildren().get( 0 ) instanceof ActionRetractNode );

        final ActionRetractNode _a1 = (ActionRetractNode) _c1.getChildren().get( 0 );

        assertEquals( action.getBoundNode().getBinding(),
                      _a1.getBoundNode().getBinding() );
    }
View Full Code Here

        action1.setModify( true );
        action1.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                                new IntegerValue( 25 ) ) );
        type.addChild( action1 );

        final ActionRetractNode action2 = new ActionRetractNodeImpl( type );
        action1.addChild( action2 );

        addModelField( "Person",
                       "this",
                       "Person",
                       DataType.TYPE_THIS );
        addModelField( "Person",
                       "age",
                       Integer.class.getName(),
                       DataType.TYPE_NUMERIC_INTEGER );

        final GuidedDecisionTree model = GuidedDecisionTreeDRLPersistence.getInstance().unmarshal( drl,
                                                                                                   "test",
                                                                                                   dmo );

        assertNotNull( model );
        assertEquals( 0,
                      model.getParserErrors().size() );
        assertEquals( expected.getTreeName(),
                      model.getTreeName() );

        assertNotNull( model.getRoot() );
        assertEquals( type.getClassName(),
                      model.getRoot().getClassName() );
        assertTrue( model.getRoot().isBound() );
        assertEquals( type.getBinding(),
                      model.getRoot().getBinding() );

        assertEquals( 1,
                      model.getRoot().getChildren().size() );
        assertNotNull( model.getRoot().getChildren().get( 0 ) );
        assertTrue( model.getRoot().getChildren().get( 0 ) instanceof ActionUpdateNode );

        final ActionUpdateNode _action1 = (ActionUpdateNode) model.getRoot().getChildren().get( 0 );

        assertEquals( action1.getBoundNode().getBinding(),
                      _action1.getBoundNode().getBinding() );
        assertEquals( action1.isModify(),
                      _action1.isModify() );
        assertEquals( action1.getFieldValues().size(),
                      _action1.getFieldValues().size() );
        assertEquals( 1,
                      _action1.getFieldValues().size() );
        assertEquals( action1.getFieldValues().get( 0 ).getFieldName(),
                      _action1.getFieldValues().get( 0 ).getFieldName() );
        assertEquals( action1.getFieldValues().get( 0 ).getValue().getValue().toString(),
                      _action1.getFieldValues().get( 0 ).getValue().getValue().toString() );

        assertEquals( 1,
                      _action1.getChildren().size() );
        assertNotNull( _action1.getChildren().get( 0 ) );
        assertTrue( _action1.getChildren().get( 0 ) instanceof ActionRetractNode );

        final ActionRetractNode _action2 = (ActionRetractNode) _action1.getChildren().get( 0 );

        assertEquals( action2.getBoundNode().getBinding(),
                      _action2.getBoundNode().getBinding() );
    }
View Full Code Here

        action1.setModify( false );
        action1.getFieldValues().add( new ActionFieldValueImpl( "age",
                                                                new IntegerValue( 25 ) ) );
        type.addChild( action1 );

        final ActionRetractNode action2 = new ActionRetractNodeImpl( type );
        action1.addChild( action2 );

        addModelField( "Person",
                       "this",
                       "Person",
                       DataType.TYPE_THIS );
        addModelField( "Person",
                       "age",
                       Integer.class.getName(),
                       DataType.TYPE_NUMERIC_INTEGER );

        final GuidedDecisionTree model = GuidedDecisionTreeDRLPersistence.getInstance().unmarshal( drl,
                                                                                                   "test",
                                                                                                   dmo );

        assertNotNull( model );
        assertEquals( 0,
                      model.getParserErrors().size() );
        assertEquals( expected.getTreeName(),
                      model.getTreeName() );

        assertNotNull( model.getRoot() );
        assertEquals( type.getClassName(),
                      model.getRoot().getClassName() );
        assertTrue( model.getRoot().isBound() );
        assertEquals( type.getBinding(),
                      model.getRoot().getBinding() );

        assertEquals( 1,
                      model.getRoot().getChildren().size() );
        assertNotNull( model.getRoot().getChildren().get( 0 ) );
        assertTrue( model.getRoot().getChildren().get( 0 ) instanceof ActionUpdateNode );

        final ActionUpdateNode _action1 = (ActionUpdateNode) model.getRoot().getChildren().get( 0 );

        assertEquals( action1.getBoundNode().getBinding(),
                      _action1.getBoundNode().getBinding() );
        assertEquals( action1.isModify(),
                      _action1.isModify() );
        assertEquals( action1.getFieldValues().size(),
                      _action1.getFieldValues().size() );
        assertEquals( 1,
                      _action1.getFieldValues().size() );
        assertEquals( action1.getFieldValues().get( 0 ).getFieldName(),
                      _action1.getFieldValues().get( 0 ).getFieldName() );
        assertEquals( action1.getFieldValues().get( 0 ).getValue().getValue().toString(),
                      _action1.getFieldValues().get( 0 ).getValue().getValue().toString() );

        assertEquals( 1,
                      _action1.getChildren().size() );
        assertNotNull( _action1.getChildren().get( 0 ) );
        assertTrue( _action1.getChildren().get( 0 ) instanceof ActionRetractNode );

        final ActionRetractNode _action2 = (ActionRetractNode) _action1.getChildren().get( 0 );

        assertEquals( action2.getBoundNode().getBinding(),
                      _action2.getBoundNode().getBinding() );
    }
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionRetractNodeImpl

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.