Package org.drools.repository

Examples of org.drools.repository.ModuleItem.checkin()


            iterations++;

            if ( iterations % 50 == 0 ) {
                ModuleItem pkg1 = rulesRepository.loadModule("testHeadOOME");
                pkg1.updateDescription(System.currentTimeMillis() + "");
                pkg1.checkin("a change");
                //rulesRepository.logout(); // Breaks lifecycle of test
            }

            //fm.setRepository( new RulesRepository(TestEnvironmentSessionHelper.getSession()));
            fileManagerService.getLastModified("testHeadOOME",
View Full Code Here


        pkg2.checkout();
        repositoryPackageService.buildPackage(pkg2.getUUID(), true);       
        pkg2.checkin("version2");
        pkg2.checkout();
        repositoryPackageService.buildPackage(pkg2.getUUID(), true);      
        pkg2.checkin("version3");

        ModuleItem pkg3 = rulesRepository.createModule( "restPackageCompilationFailure",
                "this is package restPackageCompilationFailure" );

        DroolsHeader.updateDroolsHeader( "import org.drools.NonExistingClass",
View Full Code Here

        AssetItem brokenRule = pkg3.addAsset( "ruleCompilationFailure",
                "" );
        brokenRule.updateFormat(AssetFormats.DRL);
        brokenRule.updateContent("rule 'compilationFailure' when NonExistingClass() then end");
        brokenRule.checkin("version 1");
        pkg3.checkin("version2");
       
        logoutAs("admin");
    }
   
    @Test @RunAsClient
View Full Code Here

        assertEquals( pkg.getName(),
                      bin.getName() );
        assertTrue( bin.isValid() );

        pkg.updateDependency( "model?version=2" );
        pkg.checkin( "Update dependency" );

        PackageAssembler asm2 = new PackageAssembler();
        asm2.init(pkg, null);
        asm2.compile();
        assertFalse( asm2.getErrors().toString(),
View Full Code Here

        moduleItem.updateBinaryUpToDate( false );
        if(!data.getFormat().equals("")) {
            moduleItem.updateFormat(data.getFormat());
        }
        RuleBaseCache.getInstance().remove( data.getUuid() );
        moduleItem.checkin( data.getDescription() );

        // If module is archived, archive all the assets under it
        if ( data.isArchived() ) {
            handleArchivedForSaveModule( data,
                    moduleItem );
View Full Code Here

    @LoggedIn
    public void updateDependency(String uuid,
                                 String dependencyPath) {
        ModuleItem item = rulesRepository.loadModuleByUUID( uuid );
        item.updateDependency( dependencyPath );
        item.checkin( "Update dependency" );
    }

    public String[] getDependencies(String uuid) {
        ModuleItem item = rulesRepository.loadModuleByUUID( uuid );
        return item.getDependencies();
View Full Code Here

               existingModuleItem.archiveItem(packageMetadata.isArchived());
               checkinComment = packageMetadata.getCheckinComment();
           }

            existingModuleItem.updateBinaryUpToDate(false);
            existingModuleItem.checkin(checkinComment);
            rulesRepository.save();
       } catch (JAXBException e) {
           throw new WebApplicationException(e);
       } catch (RuntimeException e) {
            throw new WebApplicationException(e);
View Full Code Here

           
            existingModuleItem.updateDescription(module.getDescription());
           
            /* TODO: add more updates to package item from JSON */
            existingModuleItem.updateBinaryUpToDate(false);
            existingModuleItem.checkin(module.getMetadata().getCheckinComment());
            rulesRepository.save();
        } catch (RuntimeException e) {
            throw new WebApplicationException(e);
        }
    }
View Full Code Here

                //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);
                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.");
View Full Code Here

        assertEquals( pkg.getName(),
                      bin.getName() );
        assertTrue( bin.isValid() );

        pkg.updateDependency( "model?version=2" );
        pkg.checkin( "Update dependency" );

        PackageAssembler asm2 = new PackageAssembler();
        asm2.init(pkg, null);
        asm2.compile();
        assertFalse( asm2.getErrors().toString(),
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.