Package org.drools.workbench.models.guided.dtable.shared.model

Examples of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52


                    }
                }
            }

        } else if ( baseColumn instanceof ActionInsertFactCol52 ) {
            final ActionInsertFactCol52 baseActionColumn = (ActionInsertFactCol52) baseColumn;
            final String binding = baseActionColumn.getBoundName();
            for ( ActionCol52 ac : this.model.getActionCols() ) {
                if ( ac instanceof ActionInsertFactCol52 ) {
                    final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac;
                    if ( aif.getBoundName().equals( binding ) ) {
                        if ( oracle.isDependentEnum( baseActionColumn.getFactType(),
                                                     baseActionColumn.getFactField(),
                                                     aif.getFactField() ) ) {
                            dependentColumnIndexes.add( model.getExpandedColumns().indexOf( ac ) );
                        }
                    }
                }
            }
View Full Code Here


    private boolean allowEmptyValues() {
        return this.model.getTableFormat() == TableFormat.EXTENDED_ENTRY;
    }

    private ActionInsertFactCol52 cloneActionInsertColumn( ActionInsertFactCol52 col ) {
        ActionInsertFactCol52 clone = null;
        if ( col instanceof LimitedEntryActionInsertFactCol52 ) {
            clone = new LimitedEntryActionInsertFactCol52();
            DTCellValue52 dcv = cloneLimitedEntryValue( ( (LimitedEntryCol) col ).getValue() );
            ( (LimitedEntryCol) clone ).setValue( dcv );
        } else {
            clone = new ActionInsertFactCol52();
        }
        clone.setBoundName( col.getBoundName() );
        clone.setType( col.getType() );
        clone.setFactField( col.getFactField() );
        clone.setFactType( col.getFactType() );
        clone.setHeader( col.getHeader() );
        clone.setValueList( col.getValueList() );
        clone.setDefaultValue( new DTCellValue52( col.getDefaultValue() ) );
        clone.setHideColumn( col.isHideColumn() );
        clone.setInsertLogical( col.isInsertLogical() );
        return clone;
    }
View Full Code Here

        ListBox patterns = new ListBox();

        for ( Object o : model.getActionCols() ) {
            ActionCol52 col = (ActionCol52) o;
            if ( col instanceof ActionInsertFactCol52 ) {
                ActionInsertFactCol52 c = (ActionInsertFactCol52) col;
                if ( !vars.contains( c.getBoundName() ) ) {
                    patterns.addItem( c.getFactType()
                                              + " ["
                                              + c.getBoundName()
                                              + "]",
                                      c.getFactType()
                                              + " "
                                              + c.getBoundName() );
                    vars.add( c.getBoundName() );
                }
            }

        }
View Full Code Here

                    }
                }
            }

        } else if ( baseColumn instanceof ActionInsertFactCol52 ) {
            ActionInsertFactCol52 baseActionColumn = (ActionInsertFactCol52) baseColumn;
            final String binding = baseActionColumn.getBoundName();
            for ( ActionCol52 ac : this.model.getActionCols() ) {
                if ( ac instanceof ActionInsertFactCol52 ) {
                    final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac;
                    if ( aif.getBoundName().equals( binding ) ) {
                        final int iCol = allColumns.indexOf( aif );
                        currentValueMap.put( aif.getFactField(),
                                             getValue( aif,
                                                       rowData.get( iCol ) ) );
                    }
                }
            }
View Full Code Here

                    }
                }
            }

        } else if ( baseColumn instanceof ActionInsertFactCol52 ) {
            final ActionInsertFactCol52 baseActionColumn = (ActionInsertFactCol52) baseColumn;
            final String binding = baseActionColumn.getBoundName();
            for ( ActionCol52 ac : this.model.getActionCols() ) {
                if ( ac instanceof ActionInsertFactCol52 ) {
                    final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac;
                    if ( aif.getBoundName().equals( binding ) ) {
                        if ( oracle.isDependentEnum( baseActionColumn.getFactType(),
                                                     baseActionColumn.getFactField(),
                                                     aif.getFactField() ) ) {
                            dependentColumnIndexes.add( allColumns.indexOf( ac ) );
                        }
                    }
                }
            }
View Full Code Here

    }

    private ActionInsertFactCol52 makeNewActionColumn( final AvailableField f ) {
        final GuidedDecisionTable52.TableFormat format = presenter.getTableFormat();
        if ( format == GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY ) {
            final ActionInsertFactCol52 a = new ActionInsertFactCol52();
            a.setBoundName( chosenPatternsSelection.getBoundName() );
            a.setFactType( chosenPatternsSelection.getFactType() );
            a.setFactField( f.getName() );
            a.setType( f.getType() );
            return a;
        } else {
            final LimitedEntryActionInsertFactCol52 a = new LimitedEntryActionInsertFactCol52();
            a.setBoundName( chosenPatternsSelection.getBoundName() );
            a.setFactType( chosenPatternsSelection.getFactType() );
            a.setFactField( f.getName() );
            a.setType( f.getType() );
            return a;
        }

    }
View Full Code Here

                        tre.appendChild( tce );

                        //Make applicable label (TODO move to Factory method)
                        StringBuilder label = new StringBuilder();
                        if ( ac instanceof ActionInsertFactCol52 ) {
                            ActionInsertFactCol52 aifc = (ActionInsertFactCol52) ac;
                            String factType = aifc.getFactType();
                            String binding = aifc.getBoundName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                                if ( binding != null ) {
                                    label.append( " [" + binding + "]" );
                                }
                            }
                        } else if ( ac instanceof ActionSetFieldCol52 ) {
                            String factType = ( (ActionSetFieldCol52) ac ).getBoundName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        } else if ( ac instanceof LimitedEntryActionRetractFactCol52 ) {
                            String factType = ( (LimitedEntryActionRetractFactCol52) ac ).getValue().getStringValue();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        } else if ( ac instanceof ActionWorkItemCol52 ) {
                            String factType = ( (ActionWorkItemCol52) ac ).getWorkItemDefinition().getDisplayName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        } else if ( ac instanceof BRLActionVariableColumn ) {
                            String factType = ( (BRLActionVariableColumn) ac ).getVarName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        }

                        tce.appendChild( makeLabel( label.toString(),
                                                    col.getWidth(),
                                                    ( splitter.isCollapsed ? 0 : resources.rowHeaderHeight() ) ) );
                    }
                    break;

                case 3:
                    // Condition Fact Fields
                    for ( DynamicColumn<BaseColumn> col : visibleConditionCols ) {
                        tce = DOM.createTD();
                        tce.addClassName( resources.headerText() );
                        tce.addClassName( resources.headerRowIntermediate() );
                        tce.addClassName( resources.cellTableColumn( col.getModelColumn() ) );
                        tre.appendChild( tce );
                        ConditionCol52 cc = (ConditionCol52) col.getModelColumn();

                        //Make applicable label (TODO move to Factory method)
                        StringBuilder label = new StringBuilder();
                        if ( cc instanceof LimitedEntryBRLConditionColumn ) {
                            //Nothing needed
                        } else if ( cc instanceof BRLConditionVariableColumn ) {
                            BRLConditionVariableColumn brl = (BRLConditionVariableColumn) cc;
                            String field = brl.getFactField();
                            label.append( field == null ? "" : field );
                        } else if ( cc instanceof ConditionCol52 ) {
                            String factField = cc.getFactField();
                            if ( factField != null && factField.length() > 0 ) {
                                label.append( factField );
                            }
                            if ( cc.getConstraintValueType() != BaseSingleFieldConstraint.TYPE_PREDICATE ) {
                                label.append( " [" );
                                label.append( cc.getOperator() );
                                String lev = getLimitedEntryValue( cc );
                                if ( lev != null ) {
                                    label.append( lev );
                                }
                                label.append( "]" );
                            }
                        }

                        tce.appendChild( makeLabel( label.toString(),
                                                    col.getWidth(),
                                                    ( splitter.isCollapsed ? 0 : resources.rowHeaderHeight() ) ) );
                    }

                    // Action Fact Fields
                    for ( DynamicColumn<BaseColumn> col : visibleActionCols ) {
                        tce = DOM.createTD();
                        tce.addClassName( resources.headerText() );
                        tce.addClassName( resources.headerRowIntermediate() );
                        tce.addClassName( resources.cellTableColumn( col.getModelColumn() ) );
                        tre.appendChild( tce );
                        ActionCol52 ac = (ActionCol52) col.getModelColumn();

                        //Make applicable label (TODO move to Factory method)
                        StringBuilder label = new StringBuilder();
                        if ( ac instanceof ActionInsertFactCol52 ) {
                            ActionInsertFactCol52 aifc = (ActionInsertFactCol52) ac;
                            String factField = aifc.getFactField();
                            if ( factField != null && factField.length() > 0 ) {
                                label.append( factField );
                            }
                            String lev = getLimitedEntryValue( aifc );
                            if ( lev != null ) {
View Full Code Here

                    }
                }
            }

        } else if ( baseColumn instanceof ActionInsertFactCol52 ) {
            ActionInsertFactCol52 baseActionColumn = (ActionInsertFactCol52) baseColumn;
            final String binding = baseActionColumn.getBoundName();
            for ( ActionCol52 ac : this.model.getActionCols() ) {
                if ( ac instanceof ActionInsertFactCol52 ) {
                    final ActionInsertFactCol52 aif = (ActionInsertFactCol52) ac;
                    if ( aif.getBoundName().equals( binding ) ) {
                        currentValueMap.put( aif.getFactField(),
                                             getValue( aif ) );
                    }
                }
            }
View Full Code Here

        view.setAvailableFactTypes( availableTypes );

        //Existing ActionInsertFactCols (should be empty for a new Decision Table)
        for ( ActionCol52 a : model.getActionCols() ) {
            if ( a instanceof ActionInsertFactCol52 ) {
                final ActionInsertFactCol52 aif = (ActionInsertFactCol52) a;
                final ActionInsertFactFieldsPattern p = lookupExistingInsertFactPattern( aif.getBoundName() );
                final List<ActionInsertFactCol52> actions = patternToActionsMap.get( p );
                getValidator().addActionPattern( p );
                actions.add( aif );
            }
        }
View Full Code Here

                        tre.appendChild( tce );

                        //Make applicable label (TODO move to Factory method)
                        StringBuilder label = new StringBuilder();
                        if ( ac instanceof ActionInsertFactCol52 ) {
                            ActionInsertFactCol52 aifc = (ActionInsertFactCol52) ac;
                            String factType = aifc.getFactType();
                            String binding = aifc.getBoundName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                                if ( binding != null ) {
                                    label.append( " [" + binding + "]" );
                                }
                            }
                        } else if ( ac instanceof ActionSetFieldCol52 ) {
                            String factType = ( (ActionSetFieldCol52) ac ).getBoundName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        } else if ( ac instanceof LimitedEntryActionRetractFactCol52 ) {
                            String factType = ( (LimitedEntryActionRetractFactCol52) ac ).getValue().getStringValue();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        } else if ( ac instanceof ActionWorkItemCol52 ) {
                            String factType = ( (ActionWorkItemCol52) ac ).getWorkItemDefinition().getDisplayName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        } else if ( ac instanceof BRLActionVariableColumn ) {
                            String factType = ( (BRLActionVariableColumn) ac ).getVarName();
                            if ( factType != null && factType.length() > 0 ) {
                                label.append( factType );
                            }
                        }

                        tce.appendChild( makeLabel( label.toString(),
                                                    col.getWidth(),
                                                    ( splitter.isCollapsed ? 0 : resources.rowHeaderHeight() ) ) );
                    }
                    break;

                case 3:
                    // Condition Fact Fields
                    for ( DynamicColumn<BaseColumn> col : visibleConditionCols ) {
                        tce = DOM.createTD();
                        tce.addClassName( resources.headerText() );
                        tce.addClassName( resources.headerRowIntermediate() );
                        tce.addClassName( resources.cellTableColumn( col.getModelColumn() ) );
                        tre.appendChild( tce );
                        ConditionCol52 cc = (ConditionCol52) col.getModelColumn();

                        //Make applicable label (TODO move to Factory method)
                        StringBuilder label = new StringBuilder();
                        if ( cc instanceof LimitedEntryBRLConditionColumn ) {
                            //Nothing needed
                        } else if ( cc instanceof BRLConditionVariableColumn ) {
                            BRLConditionVariableColumn brl = (BRLConditionVariableColumn) cc;
                            String field = brl.getFactField();
                            label.append( field == null ? "" : field );
                        } else {
                            String factField = cc.getFactField();
                            if ( factField != null && factField.length() > 0 ) {
                                label.append( factField );
                            }
                            if ( cc.getConstraintValueType() != BaseSingleFieldConstraint.TYPE_PREDICATE ) {
                                label.append( " [" );
                                label.append( cc.getOperator() );
                                String lev = getLimitedEntryValue( cc );
                                if ( lev != null ) {
                                    label.append( lev );
                                }
                                label.append( "]" );
                            }
                        }

                        tce.appendChild( makeLabel( label.toString(),
                                                    col.getWidth(),
                                                    ( splitter.isCollapsed ? 0 : resources.rowHeaderHeight() ) ) );
                    }

                    // Action Fact Fields
                    for ( DynamicColumn<BaseColumn> col : visibleActionCols ) {
                        tce = DOM.createTD();
                        tce.addClassName( resources.headerText() );
                        tce.addClassName( resources.headerRowIntermediate() );
                        tce.addClassName( resources.cellTableColumn( col.getModelColumn() ) );
                        tre.appendChild( tce );
                        ActionCol52 ac = (ActionCol52) col.getModelColumn();

                        //Make applicable label (TODO move to Factory method)
                        StringBuilder label = new StringBuilder();
                        if ( ac instanceof ActionInsertFactCol52 ) {
                            ActionInsertFactCol52 aifc = (ActionInsertFactCol52) ac;
                            String factField = aifc.getFactField();
                            if ( factField != null && factField.length() > 0 ) {
                                label.append( factField );
                            }
                            String lev = getLimitedEntryValue( aifc );
                            if ( lev != null ) {
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52

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.