Examples of Characteristic


Examples of org.drools.workbench.models.guided.scorecard.shared.Characteristic

        model.setFactName( "org.drools.workbench.models.guided.scorecard.backend.test1.Applicant" );
        model.setFieldName( "score" );
        model.setUseReasonCodes( false );
        model.setReasonCodeField( "" );

        final Characteristic c = new Characteristic();
        c.setName( "c1" );
        c.setFact( "org.drools.workbench.models.guided.scorecard.backend.test1.Applicant" );
        c.setDataType( "Double" );
        c.setField( "age" );
        c.setBaselineScore( 0.0 );
        c.setReasonCode( "" );

        final Attribute a = new Attribute();
        a.setOperator( "=" );
        a.setValue( "10" );
        a.setPartialScore( 0.1 );
        a.setReasonCode( "" );

        c.getAttributes().add( a );
        model.getCharacteristics().add( c );

        final String drl1 = GuidedScoreCardDRLPersistence.marshal( model );
        assertNotNull( drl1 );
View Full Code Here

Examples of org.drools.workbench.models.guided.scorecard.shared.Characteristic

        model.setFactName( "org.drools.workbench.models.guided.scorecard.backend.test1.Applicant" );
        model.setFieldName( "score" );
        model.setUseReasonCodes( false );
        model.setReasonCodeField( "" );

        final Characteristic c = new Characteristic();
        c.setName( "c1" );
        c.setFact( "org.drools.workbench.models.guided.scorecard.backend.test1.ApplicantAttribute" );
        c.setDataType( "int" );
        c.setField( "attribute" );
        c.setBaselineScore( 0.0 );
        c.setReasonCode( "" );

        final Attribute a = new Attribute();
        a.setOperator( "=" );
        a.setValue( "10" );
        a.setPartialScore( 0.1 );
        a.setReasonCode( "" );

        c.getAttributes().add( a );
        model.getCharacteristics().add( c );

        return model;
    }
View Full Code Here

Examples of org.drools.workbench.models.guided.scorecard.shared.Characteristic

        model.setName( name );

        model.setFactName( "Applicant" );
        model.setFieldName( "age" );

        final Characteristic c = new Characteristic();
        c.setName( "c1" );
        c.setFact( "Mortgage" );
        c.setField( "amount" );
        c.setDataType( DataType.TYPE_NUMERIC_INTEGER );

        model.getCharacteristics().add( c );

        return model;
    }
View Full Code Here

Examples of org.drools.workbench.models.guided.scorecard.shared.Characteristic

            model.setReasonCodeField( rcField );
        }

        model.getCharacteristics().clear();
        for ( final DirtyableFlexTable flexTable : characteristicsTables ) {
            final Characteristic characteristic = new Characteristic();
            characteristic.setName( ( (TextBox) flexTable.getWidget( 0,
                                                                     1 ) ).getValue() );

            //Characteristic Fact Type
            enumDropDown = (ListBox) flexTable.getWidget( 2,
                                                          0 );
            if ( enumDropDown.getSelectedIndex() > -1 ) {
                final String simpleFactName = enumDropDown.getValue( enumDropDown.getSelectedIndex() );
                characteristic.setFact( simpleFactName );
                oracle.getFieldCompletions( simpleFactName,
                                            new Callback<ModelField[]>() {
                                                @Override
                                                public void callback( final ModelField[] fields ) {
                                                    if ( fields != null ) {
                                                        for ( ModelField mf : fields ) {
                                                            if ( mf.getType().equals( simpleFactName ) ) {
                                                                characteristic.setFact( mf.getClassName() );
                                                                break;
                                                            }
                                                        }
                                                    }
                                                }
                                            } );

                //Characteristic Field (cannot be set if no Fact Type has been set)
                enumDropDown = (ListBox) flexTable.getWidget( 2,
                                                              1 );
                if ( enumDropDown.getSelectedIndex() > -1 ) {
                    String fieldName = enumDropDown.getValue( enumDropDown.getSelectedIndex() );
                    fieldName = fieldName.substring( 0, fieldName.indexOf( ":" ) ).trim();
                    characteristic.setField( fieldName );
                } else {
                    characteristic.setField( "" );
                }
                getDataTypeForField( simpleFactName,
                                     characteristic.getField(),
                                     new Callback<String>() {
                                         @Override
                                         public void callback( final String result ) {
                                             characteristic.setDataType( result );
                                         }
                                     } );
            }

            //Characteristic Reason Code
            characteristic.setReasonCode( ( (TextBox) flexTable.getWidget( 2,
                                                                           3 ) ).getValue() );

            //Characteristic Base Line Score
            final String baselineScore = ( (TextBox) flexTable.getWidget( 2,
                                                                          2 ) ).getValue();
            try {
                characteristic.setBaselineScore( Double.parseDouble( baselineScore ) );
            } catch ( Exception e ) {
                characteristic.setBaselineScore( 0.0d );
            }

            //Characteristic Attributes
            characteristic.getAttributes().clear();
            characteristic.getAttributes().addAll( characteristicsAttrMap.get( flexTable ).getList() );

            model.getCharacteristics().add( characteristic );
        }

        return model;
View Full Code Here

Examples of org.sonar.api.technicaldebt.batch.Characteristic

        if (metric == null) {
          throw new IllegalStateException("Unknow metric with key: " + measure.getMetric().getKey());
        }
        metricId = metric.getId();
      }
      Characteristic characteristic = measure.getCharacteristic();
      Integer characteristicId = characteristic != null ? characteristic.id() : null;
      Integer personId = measure.getPersonId();
      Integer ruleId = null;
      if (measure instanceof RuleMeasure) {
        Rule rule = ruleFinder.findByKey(((RuleMeasure) measure).ruleKey());
        if (rule != null) {
View Full Code Here

Examples of org.sonar.api.technicaldebt.batch.Characteristic

    List<Measure> result = Lists.newArrayList();

    for (Object[] object : objects) {
      MeasureModel model = (MeasureModel) object[0];
      Integer characteristicId = model.getCharacteristicId();
      Characteristic characteristic = techDebtModel.characteristicById(characteristicId);
      Measure measure = toMeasure(model, metricById.get(model.getMetricId()), characteristic);
      measure.setDate((Date) object[1]);
      result.add(measure);
    }
    return result;
View Full Code Here

Examples of org.sonar.api.technicaldebt.batch.Characteristic

    if (debt != null) {
      Rule rule = rules.find(ruleKey);
      if (rule != null) {
        String characteristicKey = rule.debtSubCharacteristic();
        if (characteristicKey != null) {
          Characteristic characteristic = model.characteristicByKey(characteristicKey);
          if (characteristic != null) {
            ruleDebts.add(ruleKey, debt);
            characteristicDebts.add(characteristic, debt);
            propagateTechnicalDebtInParents(characteristic.parent(), debt, characteristicDebts);
            return debt;
          }
        }
      }
    }
View Full Code Here

Examples of org.sonar.api.technicaldebt.batch.Characteristic

      }
    };
  }

  private static boolean isSameCharacteristic(Measure measure, final Characteristic characteristic) {
    Characteristic measureCharacteristic = measure.getCharacteristic();
    return measureCharacteristic != null &&
      measureCharacteristic.equals(characteristic);
  }
View Full Code Here

Examples of org.sonar.api.technicaldebt.batch.Characteristic

    measure = new Measure(CoreMetrics.NCLOC);
    measure.setData("data");
    measure.setAlertStatus(Level.ERROR);
    measure.setAlertText("alert");
    Characteristic c = mock(Characteristic.class);
    when(c.id()).thenReturn(1);
    when(techDebtModel.characteristicById(1)).thenReturn(c);
    measure.setCharacteristic(c);
    measure.setDate(new Date());
    measure.setDescription("description");
    measure.setPersistenceMode(null);
View Full Code Here

Examples of org.sonar.api.technicaldebt.batch.Characteristic

    model.setVariationValue2(measure.getVariation2());
    model.setVariationValue3(measure.getVariation3());
    model.setVariationValue4(measure.getVariation4());
    model.setVariationValue5(measure.getVariation5());
    model.setUrl(measure.getUrl());
    Characteristic characteristic = measure.getCharacteristic();
    if (characteristic != null) {
      model.setCharacteristicId(characteristic.id());
    }
    model.setPersonId(measure.getPersonId());
    model.setValue(measure.getValue());
    if (measure instanceof RuleMeasure) {
      RuleMeasure ruleMeasure = (RuleMeasure) measure;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.