Examples of updateFormat()


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

            } else {

                AssetItem asset = pkg.addAsset( as.name,
                                                "<imported>" );
                asset.updateFormat( as.format );

                asset.updateContent( as.content );
                asset.updateExternalSource( "Imported from external DRL" );
                if ( newVer ) asset.checkin( "Imported change from external DRL" );
View Full Code Here

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

            //Asset format and asset file extension are 2 different things. We simply do not have the asset type information available when the
            //asset is created from binary. The asset format needs to be filled by a following update operation.
            //But we can do our best to guess the format here, i.e., assume the format is equal to the extension type. User can always update
            //the format later on
            if (extension != null) {
                ai.updateFormat(extension);
            }
            ai.updateBinaryContentAttachment(is);
            ai.getModule().updateBinaryUpToDate(false);
            ai.checkin("update binary");
            rulesRepository.save();
View Full Code Here

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

            //Update asset
            ai.checkout();
            ai.updateTitle(assetEntry.getTitle());
            ai.updateDescription(assetEntry.getSummary());
            if (format != null) {
                ai.updateFormat(format);
            }
           
            //REVISIT: What if the client really wants to set content to ""?
            if (assetEntry.getContent() != null && !"".equals(assetEntry.getContent())) {
                ai.updateContent(assetEntry.getContent());
View Full Code Here

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

        }

        AssetItem ai = rulesRepository.loadModule(packageName).addAsset(assetName, asset.getDescription());
        ai.checkout();
        ai.updateBinaryContentAttachmentFileName(asset.getBinaryContentAttachmentFileName());
        ai.updateFormat(asset.getMetadata().getFormat());
        ai.updateBinaryContentAttachment(is);
        ai.getModule().updateBinaryUpToDate(false);
        ai.checkin(asset.getMetadata().getCheckInComment());
        rulesRepository.save();
        return asset;
View Full Code Here

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

        AssetItem ai = rulesRepository.loadModule(packageName).loadAsset(assetName);
        ai.checkout();
        ai.updateDescription(asset.getDescription());
        ai.updateBinaryContentAttachmentFileName(asset.getBinaryContentAttachmentFileName());
        ai.updateFormat(asset.getMetadata().getFormat());
        ai.updateBinaryContentAttachment(is);
        ai.getModule().updateBinaryUpToDate(false);
        ai.checkin(asset.getMetadata().getCheckInComment());
        rulesRepository.save();
        return asset;
View Full Code Here

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

        assertTrue( drl.indexOf( "rule" ) > -1 );
        assertTrue( drl.indexOf( "policy: Policy" ) > -1 );

        AssetItem dsl = pkg.addAsset( "MyDSL",
                                      "" );
        dsl.updateFormat( AssetFormats.DSL );
        dsl.updateContent( "[when]This is foo=bar()\n[then]do something=yeahMan();" );
        dsl.checkin( "" );

        asset = pkg.addAsset( "MyDSLRule",
                              "" );
View Full Code Here

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

        // pkg.updateHeader( "import com.billasurf.Person" );

        AssetItem asset = pkg.addAsset( "testRule",
                                        "" );
        asset.updateFormat( AssetFormats.DRL );
        asset.updateContent( "rule 'MyGoodRule' \n when \n then \n end" );
        asset.checkin( "" );
        repo.save();
        RepositoryAssetService repositoryAssetService = getRepositoryAssetService();
        RuleAsset rule = repositoryAssetService.loadRuleAsset( asset.getUUID() );
View Full Code Here

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

                                                  "==" ) );
        sc.getFixtures().add( vf );

        AssetItem scenario1 = pkg.addAsset( "scen1",
                                            "" );
        scenario1.updateFormat( AssetFormats.TEST_SCENARIO );
        scenario1.updateContent( ScenarioXMLPersistence.getInstance().marshal( sc ) );
        scenario1.checkin( "" );

        //now the bad scenario
        sc = new Scenario();
View Full Code Here

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

                                  null );
        sc.getFixtures().add( vr );

        AssetItem scenario2 = pkg.addAsset( "scen2",
                                            "" );
        scenario2.updateFormat( AssetFormats.TEST_SCENARIO );
        scenario2.updateContent( ScenarioXMLPersistence.getInstance().marshal( sc ) );
        scenario2.checkin( "" );

        BulkTestRunResult result = repositoryPackageService.runScenariosInPackage( pkg.getUUID() );
        assertNull( result.getResult() );
View Full Code Here

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

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

        DroolsHeader.updateDroolsHeader( "import com.billasurf.Board",
                                                  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.