Package org.drools.repository

Examples of org.drools.repository.RulesRepositoryException


                if (pkg.containsAsset(a[0])) {
                    asset = pkg.loadAsset(a[0]);
                    if (asset.isArchived()) {
                        asset.archiveItem(false);
                    } else {
                        throw new RulesRepositoryException("The file " + path + " already exists, and was not archived.");
                    }
                    if (asset.isBinary()) {
                        asset.updateBinaryContentAttachment(in);
                    } else {
                        asset.updateContent(readContent(in));
View Full Code Here


            String[] a = fileName.split("\\.");
            PackageItem pkg = repo.loadPackage(bits[1]);
            if (a[1].equals("package")) {
                //updating package header
                if (lastModified != null && pkg.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The package was modified by: " + pkg.getLastContributor() + ", unable to write changes.");
                }
                pkg.updateStringProperty(readContent(in), PackageItem.HEADER_PROPERTY_NAME);
                pkg.checkin(comment);
                repo.save();
            } else {
                AssetItem as = pkg.loadAsset(a[0]);
                if (lastModified != null && as.getLastModified().after(lastModified)) {
                    throw new RulesRepositoryException("The asset was modified by: " + as.getLastContributor() + ", unable to write changes.");
                }
                if (as.isBinary()) {
                    as.updateBinaryContentAttachment(in);
                } else {
                    as.updateContent(readContent(in));
View Full Code Here

        log.info( "USER:" + getCurrentUserName() + " export package [name: " + packageName + "] " );

        try {
            return getRulesRepository().dumpPackageFromRepositoryXml( packageName );
        } catch (PathNotFoundException e) {
            throw new RulesRepositoryException( e );
        } catch (IOException e) {
            throw new RulesRepositoryException( e );
        } catch (RepositoryException e) {
            throw new RulesRepositoryException( e );
        }
    }
View Full Code Here

        try {
            AssetItem item = getRulesRepository().loadAssetByUUID(uuid);
            serviceSecurity.checkIsPackageDeveloperOrAnalyst(item);

            if (item.getPackage().isArchived()) {
                throw new RulesRepositoryException("The package [" + item.getPackageName() + "] 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 {
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

    private void loadFunctions() {
        try {
            addDrl( getAllFunctionsAsOneString().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

        RulesRepositoryAdministrator admin = new RulesRepositoryAdministrator(sessionForSetup);
        if (!admin.isRepositoryInitialized()) {
            try {
                configurator.setupRepository(sessionForSetup);
            } catch (RepositoryException e) {
                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

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

                    data.setFile( item );
                }
            }
            return data;
        } catch ( FileUploadException 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.