Package org.drools.repository

Examples of org.drools.repository.AssetItem.updateBinaryContentAttachment()


                                              "" );

        AssetItem model = pkg.addAsset( "MyModel",
                                        "" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );
        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board",
                                                  pkg );

        AssetItem m2 = pkg.addAsset( "MyModel2",
View Full Code Here


        PackageItem pkg = repo.createPackage( "testRunScenarioWithJar",
                                              "" );
        AssetItem model = pkg.addAsset( "MyModel",
                                        "" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board",
                                                  pkg );
View Full Code Here

        PackageItem pkg = repo.createPackage( "testRunScenarioWithJarThatHasSourceFiles",
                                              "" );
        AssetItem model = pkg.addAsset( "MyModel",
                                        "" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/jarWithSourceFiles.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import org.test.Person; \n import org.test.Banana; \n ",
                                                  pkg );
View Full Code Here

        PackageItem pkg = repo.createPackage( "testAvailableTypes",
                                              "" );
        AssetItem model = pkg.addAsset( "MyModel",
                                        "" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );
        repo.save();

        String[] s = impl.listTypesInPackage( pkg.getUUID() );
        assertNotNull( s );
View Full Code Here

                      drl );

        asset = pkg.addAsset( "DT",
                              "" );
        asset.updateFormat( AssetFormats.DECISION_SPREADSHEET_XLS );
        asset.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/SampleDecisionTable.xls" ) );
        asset.checkin( "" );

        rule = impl.loadRuleAsset( asset.getUUID() );
        drl = impl.buildAssetSource( rule );
        assertNotNull( drl );
View Full Code Here

        PackageItem pkg = repo.createPackage( "testBuildAssetWithError",
                                              "" );
        AssetItem model = pkg.addAsset( "MyModel",
                                        "" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Person",
                                                  pkg );
View Full Code Here

        PackageItem pkg = repo.createPackage( "testBuildAsset",
                                              "" );
        AssetItem model = pkg.addAsset( "MyModel",
                                        "" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Person",
                                                  pkg );
View Full Code Here

        PackageItem pkg = repo.createPackage( "testBuildAssetBRL",
                                              "" );
        AssetItem model = pkg.addAsset( "MyModel",
                                        "" );
        model.updateFormat( AssetFormats.MODEL );
        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Person",
                                                  pkg );
        impl.createCategory( "/",
View Full Code Here

                    while ( (line = reader.readLine()) != null ) {
                        if ( !line.startsWith( "package " ) ) {
                            sb.append( line ).append( "\n" );
                        }
                    }
                    asset.updateBinaryContentAttachment( new ByteArrayInputStream( sb.toString().getBytes( "UTF-8" ) ) );
                } catch ( Exception e ) {
                    //default
                    asset.updateBinaryContentAttachment( content );
                }
            } else {
View Full Code Here

                        }
                    }
                    asset.updateBinaryContentAttachment( new ByteArrayInputStream( sb.toString().getBytes( "UTF-8" ) ) );
                } catch ( Exception e ) {
                    //default
                    asset.updateBinaryContentAttachment( content );
                }
            } else {
                asset.updateBinaryContentAttachment( content );
            }
            //here we could save, or check in, depending on if enough time has passed to justify
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.