Package org.drools.workbench.models.commons.shared.rule

Examples of org.drools.workbench.models.commons.shared.rule.RuleModel


    }

    @Override
    public GuidedEditorContent loadContent( final Path path ) {
        try {
            final RuleModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            return new GuidedEditorContent( oracle,
                                            model );

        } catch ( Exception e ) {
View Full Code Here


    @Override
    public void create( final Package pkg,
                        final String baseFileName,
                        final NewResourcePresenter presenter ) {
        final RuleModel ruleModel = new RuleModel();
        final boolean useDSL = useDSLCheckbox.getValue();
        final ClientResourceType resourceType = ( useDSL ? resourceTypeDSLR : resourceTypeDRL );
        ruleModel.name = baseFileName;

        busyIndicatorView.showBusyIndicator( CommonConstants.INSTANCE.Saving() );
View Full Code Here

    }

    private boolean hasVariables( BRLActionColumn column ) {
        Map<InterpolationVariable, Integer> ivs = new HashMap<InterpolationVariable, Integer>();
        RuleModel rm = new RuleModel();
        for ( IAction action : column.getDefinition() ) {
            rm.addRhsItem( action );
        }
        RuleModelVisitor rmv = new RuleModelVisitor( ivs );
        rmv.visit( rm );
        return ivs.size() > 0;
    }
View Full Code Here

    }

    private boolean hasVariables( BRLConditionColumn column ) {
        Map<InterpolationVariable, Integer> ivs = new HashMap<InterpolationVariable, Integer>();
        RuleModel rm = new RuleModel();
        for ( IPattern pattern : column.getDefinition() ) {
            rm.addLhsItem( pattern );
        }
        RuleModelVisitor rmv = new RuleModelVisitor( ivs );
        rmv.visit( rm );
        return ivs.size() > 0;
    }
View Full Code Here

                    }
                }

            } else if ( col instanceof BRLConditionColumn ) {
                //Delegate to super class's implementation
                final RuleModel rm = new RuleModel();
                final BRLConditionColumn brl = (BRLConditionColumn) col;
                rm.lhs = brl.getDefinition().toArray( new IPattern[ brl.getDefinition().size() ] );
                variables.addAll( rm.getBoundVariablesInScope( con ) );
            }
        }
        variables.addAll( super.getBoundVariablesInScope( con ) );
        return new ArrayList<String>( variables );
    }
View Full Code Here

    }

    private RuleModel getRuleModel( ExpandedDRLInfo expandedDRLInfo, PackageDataModelOracle dmo ) {
        //De-serialize model
        RuleDescr ruleDescr = parseDrl( expandedDRLInfo );
        RuleModel model = new RuleModel();
        model.name = ruleDescr.getName();
        model.parentName = ruleDescr.getParentName();

        Map<String, AnnotationDescr> annotations = ruleDescr.getAnnotations();
        if (annotations != null) {
            for (AnnotationDescr annotation : annotations.values()) {
                model.addMetadata( new RuleMetadata( annotation.getName(), annotation.getValue().toString() ) );
            }
        }

        //De-serialize Package name
        final String packageName = PackageNameParser.parsePackageName( expandedDRLInfo.plainDrl );
        model.setPackageName( packageName );

        //De-serialize imports
        final Imports imports = ImportsParser.parseImports( expandedDRLInfo.plainDrl );
        for ( Import item : imports.getImports() ) {
            model.getImports().addImport( item );
        }

        boolean isJavaDialect = parseAttributes( model,
                                                 ruleDescr.getAttributes() );
        Map<String, String> boundParams = parseLhs( model, ruleDescr.getLhs(), expandedDRLInfo, dmo );
View Full Code Here

        col2.setFieldType( DataType.TYPE_BOOLEAN );
        col2.setOperator( "!=" );
        p2.getChildColumns().add( col2 );
        allColumns.add( col2 );

        RuleModel rm = new RuleModel();

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

        col2.setFieldType( DataType.TYPE_DATE );
        col2.setOperator( "!=" );
        p2.getChildColumns().add( col2 );
        allColumns.add( col2 );

        RuleModel rm = new RuleModel();

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

        col2.setFieldType( DataType.TYPE_NUMERIC_INTEGER );
        col2.setOperator( "!=" );
        p2.getChildColumns().add( col2 );
        allColumns.add( col2 );

        RuleModel rm = new RuleModel();

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

        col2.setFieldType( DataType.TYPE_STRING );
        col2.setOperator( "!=" );
        p2.getChildColumns().add( col2 );
        allColumns.add( col2 );

        RuleModel rm = new RuleModel();

        //When using a TemplateDataProvider the assumption is that we
        //have a "complete" decision table including AnalysisCol52
        allColumns.add( new AnalysisCol52() );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.commons.shared.rule.RuleModel

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.