Package org.drools.repository

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


        rule2.updateContent( "when \n foo \n then \n call a func" );
        rule2.checkin( "version 2" );
        rule3.updateContent( "declare Album2\n genre2: String \n end" );
        rule3.checkin( "version 2" );
        //impl.buildPackage(pkg.getUUID(), true);
        pkg.checkin( "version3" );           
    }
   
    @AfterClass
    public static void tearDown() {
      restTestingBase.tearDownGuvnorTestBase();
View Full Code Here


            }
            RulesRepository repository = getRepo();
            if ( repository.containsPackage( path[1] ) ) {
                PackageItem pkg = repository.loadPackage( path[1] );
                pkg.archiveItem( false );
                pkg.checkin( "<restored by webdav>" );
            } else {
                repository.createPackage( path[1],
                                          "<from webdav>" );
            }
        } else {
View Full Code Here

                item.archiveItem( true );
                item.checkin( "" );
            } else {
                //delete package
                pkg.archiveItem( true );
                pkg.checkin( "" );
            }
        } else {
            throw new IllegalArgumentException( "Not allowed to remove this file." );
        }
View Full Code Here

        item.updateExternalURI( data.externalURI );
        item.updateDescription( data.description );
        item.archiveItem( data.archived );
        item.updateBinaryUpToDate( false );
        this.ruleBaseCache.remove( data.uuid );
        item.checkin( data.description );

        // If package is archived, archive all the assets under it
        if ( data.archived ) {
            for ( Iterator<AssetItem> iter = item.getAssets(); iter.hasNext(); ) {
                AssetItem assetItem = iter.next();
View Full Code Here

            header.append( importLine ).append( "\n" );
          }
        }

    ServiceImplementation.updateDroolsHeader(header.toString(), pkg);
    pkg.checkin("Imports setup automatically on model import.");

    }

    public void onAttachmentRemoved(AssetItem item) throws IOException {
View Full Code Here

        }

        ServiceImplementation.updateDroolsHeader( header.toString(),
                                                  pkg );

        pkg.checkin( "Imports removed automatically on model archiving." );

    }

    private StringBuilder removeImportIfItExists(StringBuilder header,
                                                 String importLine) {
View Full Code Here

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

        // If package is archived, archive all the assets under it
        if ( data.isArchived() ) {
            handleArchivedForSavePackage( data,
                    item );
View Full Code Here

                                String[] selectedModules,
                                String[] unselectedModules) {
        for ( String moduleName : selectedModules ) {
            PackageItem module = getRulesRepository().loadPackage( moduleName );
            module.addWorkspace( workspace );
            module.checkin( "Add workspace" );
        }
        for ( String moduleName : unselectedModules ) {
            PackageItem module = getRulesRepository().loadPackage( moduleName );
            module.removeWorkspace( workspace );
            module.checkin( "Remove workspace" );
View Full Code Here

            module.checkin( "Add workspace" );
        }
        for ( String moduleName : unselectedModules ) {
            PackageItem module = getRulesRepository().loadPackage( moduleName );
            module.removeWorkspace( workspace );
            module.checkin( "Remove workspace" );
        }
    }

    /**
     * This will create a new asset. It will be saved, but not checked in. The
View Full Code Here

        func.updateContent( "function void foo() { System.out.println(version 2); }" );
        func.checkin( "func version 3" );

        //Package version 4    
        pkg.checkout();
        pkg.checkin( "package version 4" );

        //Verify the latest version
        PackageItem item = impl.getRulesRepository().loadPackage( "testDependencyHistoryPackage" );
        assertEquals( "package version 4",
                      item.getCheckinComment() );
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.