Package org.drools.repository

Examples of org.drools.repository.RulesRepositoryException


        log.info( "USER:" + getCurrentUserName() + " export module [name: " + moduleName + "] " );

        try {
            return rulesRepository.dumpModuleFromRepositoryXml( moduleName );
        } 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


            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

                    packageName);

            properties.putAll(properties1);
        } catch (IOException e) {
            // TODO: This is not a Exception in the Repository -Rikkola-
            throw new RulesRepositoryException("Unable to load configuration properties for package.",
                    e);
        }
        return properties;
    }
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

            try {
                m.invoke(target,
                        f.get(data));
            } catch (IllegalArgumentException e1) {
                throw new RulesRepositoryException(e1);
            } catch (IllegalAccessException e1) {
                throw new RulesRepositoryException(e1);
            } catch (InvocationTargetException e1) {
                throw new RulesRepositoryException(e1);
            }

        }

    }
View Full Code Here

                m = bean.getMethod(name,
                        new Class[]{f.getType()});
                mappings.put(f,
                        m);
            } catch (SecurityException e) {
                throw new RulesRepositoryException("Unable to map meta data",
                        e);
            } catch (NoSuchMethodException e) {
                //ignore
            }
View Full Code Here

            try {
                f.set(data,
                        m.invoke(source,
                                null));
            } catch (IllegalArgumentException e1) {
                throw new RulesRepositoryException(e1);
            } catch (IllegalAccessException e1) {
                throw new RulesRepositoryException(e1);
            } catch (InvocationTargetException e1) {
                throw new RulesRepositoryException(e1);
            }

        }

    }
View Full Code Here

                if (f.getType() == m.getReturnType()) {
                    mappings.put(f,
                            m);
                }
            } catch (SecurityException e) {
                throw new RulesRepositoryException("Unable to map meta data",
                        e);
            } catch (NoSuchMethodException e) {
                //ignore
            }
View Full Code Here

                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("\\.");
            ModuleItem pkg = rulesRepository.loadModule(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), ModuleItem.HEADER_PROPERTY_NAME);
                pkg.checkin(comment);
                rulesRepository.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

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.