Package org.drools.guvnor.server.util

Examples of org.drools.guvnor.server.util.VerifierRunner


            Identity.instance().checkPermission( new PackageUUIDType( packageUUID ),
                                                 RoleTypes.PACKAGE_DEVELOPER );
        }

        String drl = this.buildPackageSource( packageUUID );
        VerifierRunner runner = new VerifierRunner();
        return runner.verify( drl,
                              VerifierConfiguration.VERIFYING_SCOPE_KNOWLEDGE_PACKAGE );
    }
View Full Code Here


                                                 RoleTypes.PACKAGE_DEVELOPER );
        }

        String drl = "package " + asset.metaData.packageName + "\n" + getDroolsHeader( repository.loadPackage( asset.metaData.packageName ) ) + "\n" + this.buildAssetSource( asset );

        VerifierRunner runner = new VerifierRunner();

        runner.setUseDefaultConfig( useVerifierDefaultConfig );

        RuleAsset[] workingSets = loadRuleAssets( activeWorkingSets );
        List<String> constraintRules = new LinkedList<String>();
        if ( workingSets != null ) {
            for ( RuleAsset ws : workingSets ) {
                WorkingSetConfigData wsConfig = (WorkingSetConfigData) ws.content;
                if ( wsConfig.constraints != null ) {
                    for ( ConstraintConfiguration config : wsConfig.constraints ) {
                        constraintRules.add( ConstraintsFactory.getInstance().getVerifierRule( config ) );
                    }
                }
            }
        }
        if ( log.isDebugEnabled() ) {
            log.debug( "constraints rules: " + constraintRules );
        }
        try{
            if ( AssetFormats.DECISION_TABLE_GUIDED.equals( asset.metaData.format ) || AssetFormats.DECISION_SPREADSHEET_XLS.equals( asset.metaData.format ) ) {
                return runner.verify( drl,
                                      VerifierConfiguration.VERIFYING_SCOPE_DECISION_TABLE,
                                      constraintRules );
            } else {
                return runner.verify( drl,
                                      VerifierConfiguration.VERIFYING_SCOPE_SINGLE_RULE,
                                      constraintRules );
            }
        } catch (Throwable t){
            throw new SerializableException( t.getMessage() );
View Full Code Here

                                                 RoleTypes.PACKAGE_DEVELOPER );
        }

        PackageItem packageItem = getService().getRulesRepository().loadPackageByUUID( packageUUID );

        VerifierRunner runner = new VerifierRunner( defaultVerifier );

        AnalysisReport report = runner.verify( packageItem,
                                               new ScopesAgendaFilter( true,
                                                                       ScopesAgendaFilter.VERIFYING_SCOPE_KNOWLEDGE_PACKAGE ) );

        defaultVerifier.flushKnowledgeSession();
View Full Code Here

                                                        ScopesAgendaFilter.VERIFYING_SCOPE_SINGLE_RULE );
        }

        List<String> constraintRules = applyWorkingSets( activeWorkingSets );

        VerifierRunner runner;

        Verifier verifierToBeUsed = null;
        if ( useVerifierDefaultConfig ) {
            verifierToBeUsed = defaultVerifier;
        } else {
            verifierToBeUsed = getWorkingSetVerifier( constraintRules );
        }
        runner = new VerifierRunner( verifierToBeUsed );

        log.debug( "constraints rules: " + constraintRules );

        try {
            AnalysisReport report = runner.verify( packageItem,
                                                   verificationScope );

            verifierToBeUsed.flushKnowledgeSession();

            log.debug( "Asset verification took: " + (System.currentTimeMillis() - startTime) );
View Full Code Here

            Identity.instance().checkPermission( new PackageUUIDType( packageUUID ), RoleTypes.PACKAGE_DEVELOPER );
        }

        PackageItem packageItem = getAssetService().getRulesRepository().loadPackageByUUID( packageUUID );

        VerifierRunner runner = new VerifierRunner( defaultVerifier );

        AnalysisReport report = runner.verify( packageItem, new ScopesAgendaFilter( true, ScopesAgendaFilter.VERIFYING_SCOPE_KNOWLEDGE_PACKAGE ) );

        defaultVerifier.flushKnowledgeSession();

        return report;
    }
View Full Code Here

       

        log.debug( "constraints rules: " + constraintRules );

        try {
            VerifierRunner runner = new VerifierRunner( verifierToBeUsed );
            AnalysisReport report = runner.verify( packageItem, chooseScopesAgendaFilterFor( asset ) );

            verifierToBeUsed.flushKnowledgeSession();

            log.debug( "Asset verification took: " + (System.currentTimeMillis() - startTime) );
View Full Code Here

            Identity.instance().checkPermission( new PackageUUIDType( packageUUID ), RoleTypes.PACKAGE_DEVELOPER );
        }

        PackageItem packageItem = getService().getRulesRepository().loadPackageByUUID( packageUUID );

        VerifierRunner runner = new VerifierRunner( defaultVerifier );

        AnalysisReport report = runner.verify( packageItem, new ScopesAgendaFilter( true, ScopesAgendaFilter.VERIFYING_SCOPE_KNOWLEDGE_PACKAGE ) );

        defaultVerifier.flushKnowledgeSession();

        return report;
    }
View Full Code Here

       

        log.debug( "constraints rules: " + constraintRules );

        try {
            VerifierRunner runner = new VerifierRunner( verifierToBeUsed );
            AnalysisReport report = runner.verify( packageItem, chooseScopesAgendaFilterFor( asset ) );

            verifierToBeUsed.flushKnowledgeSession();

            log.debug( "Asset verification took: " + (System.currentTimeMillis() - startTime) );
View Full Code Here

            Identity.instance().checkPermission( new PackageUUIDType( packageUUID ),
                                                 RoleTypes.PACKAGE_DEVELOPER );
        }

        String drl = this.buildPackageSource( packageUUID );
        VerifierRunner runner = new VerifierRunner();
        try {
            return runner.analyse( drl );
        } catch ( DroolsParserException e ) {
            log.error( e );
            throw new DetailedSerializableException( "Unable to parse the rules.",
                                                     e.getMessage() );
        }
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.util.VerifierRunner

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.