Package org.drools.repository

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


        wm.fireAllRules();

        assertEquals( 120,
                      policy.getBasePrice() );

        asset.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/SampleDecisionTable_WithError.xls" ) );
        asset.checkin( "" );
        asm = new ContentPackageAssembler( pkg );
        assertTrue( asm.hasErrors() );
        assertEquals( asset.getName(),
                      asm.getErrors().get( 0 ).itemInError.getName() );
View Full Code Here


        assertNotNull( xls );

        AssetItem asset = pkg.addAsset( "MyDT",
                                        "" );
        asset.updateFormat( AssetFormats.DECISION_SPREADSHEET_XLS );
        asset.updateBinaryContentAttachment( xls );
        asset.checkin( "" );

        ContentPackageAssembler asm = new ContentPackageAssembler( pkg,
                                                                   true );
        String drl = asm.getDRL();
View Full Code Here

                                                  "for test" );
        AssetItem asset = pacakge.addAsset( "testModelAttachedAsset",
                                            "description" );

        InputStream is = this.getClass().getResourceAsStream( "domain.objects-1.1.8.jar" );
        asset.updateBinaryContentAttachment( is );

        ModelContentHandler modelContentHandler = new ModelContentHandler();
        modelContentHandler.onAttachmentAdded( asset );

        String header = ServiceImplementation.getDroolsHeader( pacakge );
View Full Code Here

                                        "description" );
        ServiceImplementation.updateDroolsHeader( "import something.Else\n",
                                                  pkg );

        InputStream is = this.getClass().getResourceAsStream( "domain.objects-1.1.8.jar" );
        asset.updateBinaryContentAttachment( is );

        ModelContentHandler modelContentHandler = new ModelContentHandler();
        modelContentHandler.onAttachmentAdded( asset );

        String header = ServiceImplementation.getDroolsHeader( pkg );
View Full Code Here

                                              "" );
        AssetItem model = pkg.addAsset( "model",
                                        "qed" );
        model.updateFormat( AssetFormats.MODEL );

        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board\n global com.billasurf.Person customer",
                                                  pkg );
View Full Code Here

        props1.checkin("");


        AssetItem props2 = pkg.addAsset("conf2", "");
        props2.updateFormat("conf");
        props2.updateBinaryContentAttachment(new ByteArrayInputStream("drools.accumulate.function.groupFun = org.drools.base.accumulators.MinAccumulateFunction".getBytes()));
        props2.checkin("");

        ContentPackageAssembler asm = new ContentPackageAssembler(pkg);
        assertEquals("org.drools.base.accumulators.MaxAccumulateFunction", asm.builder.getPackageBuilderConfiguration().getAccumulateFunction( "groupCount" ).getClass().getName());
        assertEquals("org.drools.base.accumulators.MinAccumulateFunction", asm.builder.getPackageBuilderConfiguration().getAccumulateFunction("groupFun").getClass().getName());
View Full Code Here

                                              "" );
        AssetItem model = pkg.addAsset( "model",
                                        "qed" );
        model.updateFormat( AssetFormats.MODEL );

        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board\n global com.billasurf.Person customer",
                                                  pkg );
View Full Code Here

                      IOUtils.toString( data ) );

        asset = pkg.addAsset( "asset2",
                              "something" );
        asset.updateFormat( "xls" );
        asset.updateBinaryContentAttachment( IOUtils.toInputStream( "This is binary" ) );
        asset.checkin( "" );

        data = imp.getResourceContent( new TransactionMock(),
                                       "foo/webdav/packages/testWebDAVContent/asset2.xls" );
        assertEquals( "This is binary",
View Full Code Here

        AssetItem ruleFlow = pkg.addAsset( "ruleFlow",
                                           "" );
        ruleFlow.updateFormat( AssetFormats.RULE_FLOW_RF );

        ruleFlow.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/ruleflow.rfm" ) );
        ruleFlow.checkin( "" );

        ContentPackageAssembler asm = new ContentPackageAssembler( pkg );
        assertFalse( asm.hasErrors() );
        Map flows = asm.getBinaryPackage().getRuleFlows();
View Full Code Here

                                              "" );
        AssetItem model = pkg.addAsset( "model",
                                        "qed" );
        model.updateFormat( AssetFormats.MODEL );

        model.updateBinaryContentAttachment( this.getClass().getResourceAsStream( "/billasurf.jar" ) );
        model.checkin( "" );

        ServiceImplementation.updateDroolsHeader( "import com.billasurf.Board\n global com.billasurf.Person customer",
                                                  pkg );
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.