Package org.drools.ide.common.client.modeldriven.dt52

Examples of org.drools.ide.common.client.modeldriven.dt52.Pattern52


        rule1.checkin( "" );
        rulesRepository.save();

        GuidedDecisionTable52 dt = new GuidedDecisionTable52();

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "p" );
        p1.setFactType( "Person" );

        ConditionCol52 col = new ConditionCol52();
        col.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        col.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        col.setFactField( "hair" );
        col.setOperator( "==" );
        p1.getChildColumns().add( col );

        dt.getConditions().add( p1 );

        ActionSetFieldCol52 ac = new ActionSetFieldCol52();
        ac.setBoundName( "p" );
View Full Code Here


        List<CompositeColumn< ? >> columns = guidedDecisionTable.getConditions();
        boolean arePatternsDraggable = columns.size() > 1 && !isReadOnly;
        for ( CompositeColumn< ? > column : columns ) {
            if ( column instanceof Pattern52 ) {
                Pattern52 p = (Pattern52) column;
                VerticalPanel patternPanel = new VerticalPanel();
                VerticalPanel conditionsPanel = new VerticalPanel();
                HorizontalPanel patternHeaderPanel = new HorizontalPanel();
                patternHeaderPanel.setStylePrimaryName( DecisionTableResources.INSTANCE.style().patternSectionHeader() );
                Label patternLabel = makePatternLabel( p );
                patternHeaderPanel.add( patternLabel );
                patternPanel.add( patternHeaderPanel );
                patternsPanel.add( patternPanel );

                //Wire-up DnD for Conditions. All DnD related widgets must be contained in the AbsolutePanel
                AbsolutePanel conditionsBoundaryPanel = new AbsolutePanel();
                PickupDragController conditionsDragController = new PickupDragController( conditionsBoundaryPanel,
                                                                                          false );
                conditionsDragController.setBehaviorConstrainedToBoundaryPanel( false );
                VerticalPanelDropController conditionsDropController = new VerticalPanelDropController( conditionsPanel );
                conditionsDragController.registerDropController( conditionsDropController );

                //Add DnD container to main Conditions container
                conditionsBoundaryPanel.add( conditionsPanel );
                patternPanel.add( conditionsBoundaryPanel );

                //Add a DragHandler to handle the actions resulting from the drag operation
                conditionsDragController.addDragHandler( new ConditionDragHandler( conditionsPanel,
                                                                                   p,
                                                                                   dtable ) );

                List<ConditionCol52> conditions = p.getChildColumns();
                boolean bAreConditionsDraggable = conditions.size() > 1 && !isReadOnly;
                for ( ConditionCol52 c : p.getChildColumns() ) {
                    HorizontalPanel hp = new HorizontalPanel();
                    hp.setStylePrimaryName( DecisionTableResources.INSTANCE.style().patternConditionSectionHeader() );
                    if ( !isReadOnly ) {
                        hp.add( removeCondition( c ) );
                    }
View Full Code Here

        return true;
    }

    //Check if the Pattern to which the Condition relates is used elsewhere
    private boolean canConditionBeDeleted(ConditionCol52 col) {
        Pattern52 pattern = guidedDecisionTable.getPattern( col );
        if ( pattern.getChildColumns().size() > 1 ) {
            return true;
        }
        if ( isBindingUsed( pattern.getBoundName() ) ) {
            return false;
        }
        return true;
    }
View Full Code Here

        rule1.checkin( "" );
        rulesRepository.save();

        GuidedDecisionTable52 dt = new GuidedDecisionTable52();

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "p" );
        p1.setFactType( "Person" );

        ConditionCol52 col = new ConditionCol52();
        col.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        col.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
        col.setFactField( "hair" );
        col.setOperator( "==" );
        p1.getChildColumns().add( col );

        dt.getConditions().add( p1 );

        ActionSetFieldCol52 ac = new ActionSetFieldCol52();
        ac.setBoundName( "p" );
View Full Code Here

    public void testImpossibleMatchesBoolean() throws ParseException {
        SuggestionCompletionEngine sce = buildSuggestionCompletionEngine();

        GuidedDecisionTable52 dt = new GuidedDecisionTable52();

        Pattern52 driverPattern = new Pattern52();
        driverPattern.setBoundName("driverPattern");
        driverPattern.setFactType("Driver");

        ConditionCol52 approved = new ConditionCol52();
        approved.setFactField("approved");
        approved.setOperator("==");
        approved.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(approved);

        ConditionCol52 disapproved = new ConditionCol52();
        disapproved.setFactField("approved");
        disapproved.setOperator("!=");
        disapproved.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(disapproved);

        dt.getConditions().add(driverPattern);

        ActionSetFieldCol52 message = new ActionSetFieldCol52();
        message.setBoundName("m");
View Full Code Here

    public void testImpossibleMatchesNumeric() throws ParseException {
        SuggestionCompletionEngine sce = buildSuggestionCompletionEngine();

        GuidedDecisionTable52 dt = new GuidedDecisionTable52();

        Pattern52 driverPattern = new Pattern52();
        driverPattern.setBoundName("driverPattern");
        driverPattern.setFactType("Driver");

        ConditionCol52 ageMinimum = new ConditionCol52();
        ageMinimum.setFactField("age");
        ageMinimum.setOperator(">=");
        ageMinimum.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(ageMinimum);

        ConditionCol52 ageMaximum = new ConditionCol52();
        ageMaximum.setFactField("age");
        ageMaximum.setOperator("<=");
        ageMaximum.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(ageMaximum);

        dt.getConditions().add(driverPattern);

        ActionSetFieldCol52 message = new ActionSetFieldCol52();
        message.setBoundName("m");
View Full Code Here

    public void testImpossibleMatchesString() throws ParseException {
        SuggestionCompletionEngine sce = buildSuggestionCompletionEngine();

        GuidedDecisionTable52 dt = new GuidedDecisionTable52();

        Pattern52 driverPattern = new Pattern52();
        driverPattern.setBoundName("driverPattern");
        driverPattern.setFactType("Driver");

        ConditionCol52 name = new ConditionCol52();
        name.setFactField("name");
        name.setOperator("==");
        name.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(name);

        ConditionCol52 notName = new ConditionCol52();
        notName.setFactField("name");
        notName.setOperator("!=");
        notName.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(notName);

        ConditionCol52 nameIn = new ConditionCol52();
        nameIn.setFactField("name");
        nameIn.setOperator("in");
        nameIn.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(nameIn);

        dt.getConditions().add(driverPattern);

        ActionSetFieldCol52 message = new ActionSetFieldCol52();
        message.setBoundName("m");
View Full Code Here

        SuggestionCompletionEngine sce = buildSuggestionCompletionEngine();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

        GuidedDecisionTable52 dt = new GuidedDecisionTable52();

        Pattern52 driverPattern = new Pattern52();
        driverPattern.setBoundName("driverPattern");
        driverPattern.setFactType("Driver");

        ConditionCol52 dateOfBirthMinimum = new ConditionCol52();
        dateOfBirthMinimum.setFactField("dateOfBirth");
        dateOfBirthMinimum.setOperator(">=");
        dateOfBirthMinimum.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(dateOfBirthMinimum);

        ConditionCol52 dateOfBirthMaximum = new ConditionCol52();
        dateOfBirthMaximum.setFactField("dateOfBirth");
        dateOfBirthMaximum.setOperator("<=");
        dateOfBirthMaximum.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(dateOfBirthMaximum);

        dt.getConditions().add(driverPattern);

        ActionSetFieldCol52 message = new ActionSetFieldCol52();
        message.setBoundName("m");
View Full Code Here

    public void testImpossibleMatchesCombination() throws ParseException {
        SuggestionCompletionEngine sce = buildSuggestionCompletionEngine();

        GuidedDecisionTable52 dt = new GuidedDecisionTable52();

        Pattern52 driverPattern = new Pattern52();
        driverPattern.setBoundName("driverPattern");
        driverPattern.setFactType("Driver");

        ConditionCol52 name = new ConditionCol52();
        name.setFactField("name");
        name.setOperator("==");
        name.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(name);

        ConditionCol52 ageMinimum = new ConditionCol52();
        ageMinimum.setFactField("age");
        ageMinimum.setOperator(">=");
        ageMinimum.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(ageMinimum);

        ConditionCol52 ageMaximum = new ConditionCol52();
        ageMaximum.setFactField("age");
        ageMaximum.setOperator("<=");
        ageMaximum.setConstraintValueType(BaseSingleFieldConstraint.TYPE_LITERAL);
        driverPattern.getChildColumns().add(ageMaximum);

        dt.getConditions().add(driverPattern);

        ActionSetFieldCol52 message = new ActionSetFieldCol52();
        message.setBoundName("m");
View Full Code Here

        at2.setAttribute( "enabled" );

        dt.getAttributeCols().add( at1 );
        dt.getAttributeCols().add( at2 );

        Pattern52 p1 = new Pattern52();
        p1.setBoundName( "c1" );
        p1.setFactType( "MyClass" );

        c1 = new ConditionCol52();
        c1.setFactField( "stringField" );
        c1.setOperator( "==" );
        c1.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p1.getChildColumns().add( c1 );
        dt.getConditions().add( p1 );

        Pattern52 p2 = new Pattern52();
        p2.setBoundName( "c2" );
        p2.setFactType( "MyClass" );

        c2 = new ConditionCol52();
        c2.setFactField( "bigDecimalField" );
        c2.setOperator( "==" );
        c2.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c2 );
        dt.getConditions().add( p2 );

        c3 = new ConditionCol52();
        c3.setFactField( "bigIntegerField" );
        c3.setOperator( "==" );
        c3.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c3 );

        c4 = new ConditionCol52();
        c4.setFactField( "byteField" );
        c4.setOperator( "==" );
        c4.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c4 );

        c5 = new ConditionCol52();
        c5.setFactField( "doubleField" );
        c5.setOperator( "==" );
        c5.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c5 );

        c6 = new ConditionCol52();
        c6.setFactField( "floatField" );
        c6.setOperator( "==" );
        c6.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c6 );

        c7 = new ConditionCol52();
        c7.setFactField( "integerField" );
        c7.setOperator( "==" );
        c7.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c7 );

        c8 = new ConditionCol52();
        c8.setFactField( "longField" );
        c8.setOperator( "==" );
        c8.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c8 );

        c9 = new ConditionCol52();
        c9.setFactField( "shortField" );
        c9.setOperator( "==" );
        c9.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p2.getChildColumns().add( c9 );

        Pattern52 p3 = new Pattern52();
        p3.setBoundName( "c3" );
        p3.setFactType( "MyClass" );

        c10 = new ConditionCol52();
        c10.setFactField( "dateField" );
        c10.setOperator( "==" );
        c10.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p3.getChildColumns().add( c10 );
        dt.getConditions().add( p3 );

        Pattern52 p4 = new Pattern52();
        p4.setBoundName( "c4" );
        p4.setFactType( "MyClass" );

        c11 = new ConditionCol52();
        c11.setFactField( "booleanField" );
        c11.setOperator( "==" );
        c11.setConstraintValueType( BaseSingleFieldConstraint.TYPE_LITERAL );
        p4.getChildColumns().add( c11 );
        dt.getConditions().add( p4 );

        a1 = new ActionSetFieldCol52();
        a1.setBoundName( "c1" );
        a1.setFactField( "stringField" );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.dt52.Pattern52

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.