Package org.drools.repository

Examples of org.drools.repository.RulesRepositoryException


    public byte[] exportPackageFromRepository(String packageName) {
        try {
            return this.repository.exportModuleFromRepository( packageName );
        } catch ( RepositoryException e ) {
            throw new RulesRepositoryException( e );
        } catch ( IOException e ) {
            throw new RulesRepositoryException( e );
        }
    }
View Full Code Here


                MigrateRepository.migrateRuleflows( repository );
            }
            RuleBaseCache.getInstance().clearCache();
        } catch ( RepositoryException e ) {
            e.printStackTrace();
            throw new RulesRepositoryException( e );
        }
    }
View Full Code Here

            if ( MigrateRepository.needsRuleflowMigration( repository ) ) {
                MigrateRepository.migrateRuleflows( repository );
            }
        } catch ( RepositoryException e ) {
            e.printStackTrace();
            throw new RulesRepositoryException( e );
        }
    }
View Full Code Here

    private void archiveOrUnarchiveAsset(String uuid,
                                         boolean archive) {
        AssetItem item = rulesRepository.loadAssetByUUID(uuid);
        serviceSecurity.checkIsPackageDeveloperOrAnalyst(item);
        if (item.getModule().isArchived()) {
            throw new RulesRepositoryException("The package [" + item.getModuleName() + "] that asset [" + item.getName() + "] belongs to is archived. You need to unarchive it first.");
        }
        log.info("USER:" + getCurrentUserName() + " ARCHIVING asset: [" + item.getName() + "] UUID: [" + item.getUUID() + "] ");
        try {
            ContentHandler handler = getContentHandler(item);
            if (handler instanceof ICanHasAttachment) {
View Full Code Here

                compile( asset,
                         (ICompilable) contentHandler );
            } catch ( DroolsParserException e ) {
                errorLogger.addError( asset,
                                      e.getMessage() );
                throw new RulesRepositoryException( e );
            } catch ( IOException e ) {
                errorLogger.addError( asset,
                                      e.getMessage() );
            }
        }
View Full Code Here

        }
       
        try {
            addDrl(stringBuilder.toString());
        } catch (IOException e) {
            throw new RulesRepositoryException(
                    "Unexpected error when parsing package.", e);
        } catch (DroolsParserException e) {
            // TODO: Not really a RulesRepositoryException is it? -Rikkola-
            throw new RulesRepositoryException(
                    "Unexpected error when parsing package.", e);
        }

        // If the function part had errors we need to add them one by one to find out which one is bad.
        if ( builder.hasErrors() ) {
View Full Code Here

            out.flush();
            out.close();      
        } catch (IOException e) {
            e.printStackTrace();
            log.error( "An error occurred building the module [" + moduleItem.getName() + "]: " + e.getMessage() );
            throw new RulesRepositoryException( "An error occurred building the module.",
                    e );
        }
        return bout.toByteArray();
    }
View Full Code Here

            Properties properties = new Properties();
            properties.putAll(guvnorBootstrapConfiguration.getProperties());
            configurator = RulesRepositoryConfigurator.getInstance(properties);
            repository = configurator.getJCRRepository();
        } catch (RepositoryException e) {
            throw new RulesRepositoryException(e);
        }
        return repository;
    }
View Full Code Here

        RulesRepositoryAdministrator admin = new RulesRepositoryAdministrator(sessionForSetup);
        if (!admin.isRepositoryInitialized()) {
            try {
                configurator.setupRepository(sessionForSetup);
            } catch (RepositoryException e) {
                throw new RulesRepositoryException(e);
            }
        }

        //
        //Migrate v4 ruleflows to v5
        //This section checks if the repository contains drools v4
        //ruleflows that need to be migrated to drools v5
        //
        RulesRepository repo = new RulesRepository(sessionForSetup);
        try {
            if (MigrateRepository.needsRuleflowMigration(repo)) {
                MigrateRepository.migrateRuleflows(repo);
            }
        } catch (RepositoryException e) {
            e.printStackTrace();
            throw new RulesRepositoryException(e);
        }
    }
View Full Code Here

    public Session newSession(String userName) {
        try {
            return configurator.login(userName);
        } catch (LoginException e) {
            throw new RulesRepositoryException("Unable to login to JCR backend.", e);
        } catch (RepositoryException e) {
            throw new RulesRepositoryException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.drools.repository.RulesRepositoryException

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.