Package org.drools.guvnor.client.rpc

Examples of org.drools.guvnor.client.rpc.Asset


        asset.updateFormat( AssetFormats.DRL );
        asset.updateContent( "rule 'n' \n when Foo() then bar(); \n end" );
        asset.checkin( "" );
        repo.save();

        Asset rule = repositoryAssetService.loadRuleAsset( asset.getUUID() );
        String drl = repositoryAssetService.buildAssetSource( rule );
        assertEquals( "rule 'n' \n when Foo() then bar(); \n end",
                      drl );

        asset = pkg.addAsset( "DT",
View Full Code Here


        asset.updateFormat( AssetFormats.DRL );
        asset.updateContent( "rule 'MyGoodRule' \n when \n then \n end" );
        asset.checkin( "" );
        repo.save();

        Asset rule = repositoryAssetService.loadRuleAsset( asset.getUUID() );

        // check its all OK
        BuilderResult result = repositoryAssetService.validateAsset( rule );
        assertTrue(result.getLines().isEmpty());
View Full Code Here

        drl += "when\n";
        drl += "P(a==true)\n";
        drl += "then\n";
        drl += "end\n";

        Asset ruleAsset = getAsset(drl);
        AnalysisReport report = verificationService.verifyAsset(
                ruleAsset,
                new HashSet<String>());

        assertNotNull(report);
View Full Code Here

                report.notes.length);

    }

    public Asset getAsset(String content) {
        Asset ruleAsset = new Asset();

        ruleAsset.setUuid( "mockUUID" );
        ruleAsset.metaData = getMetaData();
        ruleAsset.setFormat( AssetFormats.DRL);
        ruleAsset.content = getRuleContentText(content);
        return ruleAsset;
    }
View Full Code Here

        AssetItem dtItem = rulesRepository.loadAssetByUUID( uuid );
        assertEquals( dtItem.getDescription(),
                      "an initial desc" );

        Asset asset = this.repositoryAssetService.loadRuleAsset( uuid );
        GuidedDecisionTable52 retrievedContent = (GuidedDecisionTable52) asset.getContent();

        assertNotNull( retrievedContent );
        assertEquals( TableFormat.LIMITED_ENTRY,
                      retrievedContent.getTableFormat() );
View Full Code Here

            //fail( "did not get expected exception" );
        } catch ( SerializationException e ) {
            //assertTrue( e.getMessage().indexOf( "'testCreateNewRuleContainsApostropheContains' character' is not a valid path. ''' not a valid name character" ) >= 0 );
        }

        Asset assetWrapper = repositoryAssetService.loadRuleAsset( uuid );
        assertEquals( assetWrapper.getDescription(),
                      "an initial desc" );
        assertEquals( assetWrapper.getName(),
                      "testCreateNewRuleContainsApostropheContains' character" );

    }
View Full Code Here

                                                                null,
                                                                "testStatus",
                                                                AssetFormats.DRL );
        serviceImplementation.createState( "testState" );

        Asset asset = repositoryAssetService.loadRuleAsset( ruleUUID );
        assertEquals( StateItem.DRAFT_STATE_NAME,
                      asset.getState() );
        repositoryAssetService.changeState( ruleUUID,
                                            "testState" );
        asset = repositoryAssetService.loadRuleAsset( ruleUUID );
        assertEquals( "testState",
                      asset.getState() );
        asset = repositoryAssetService.loadRuleAsset( ruleUUID2 );
        assertEquals( StateItem.DRAFT_STATE_NAME,
                      asset.getState() );

        serviceImplementation.createState( "testState2" );
        repositoryAssetService.changePackageState( packagUUID,
                                                   "testState2" );

        Module pkg = repositoryPackageService.loadModule( packagUUID );
        assertEquals( "testState2",
                      pkg.getState() );

        asset = repositoryAssetService.loadRuleAsset( ruleUUID2 );
        assertEquals( "testState2",
                      asset.getState() );

        repositoryAssetService.checkinVersion( asset );
        asset = repositoryAssetService.loadRuleAsset( asset.getUuid() );
        assertEquals( "testState2",
                      asset.getState() );

    }
View Full Code Here

        assertTrue( pkg.getNode().getProperty( "drools:binaryUpToDate" ).getBoolean() );
        assertTrue( pkg.isBinaryUpToDate() );
        assertFalse( RuleBaseCache.getInstance().contains( pkg.getUUID() ) );

        Asset asset = repositoryAssetService.loadRuleAsset( rule1.getUUID() );
        repositoryAssetService.checkinVersion( asset );

        assertFalse( pkg.getNode().getProperty( "drools:binaryUpToDate" ).getBoolean() );
        assertFalse( RuleBaseCache.getInstance().contains( pkg.getUUID() ) );
View Full Code Here

                                                          "",
                                                          "testGuidedDTExecuteCategory",
                                                          pkg.getName(),
                                                          AssetFormats.DECISION_TABLE_GUIDED );

        Asset ass = repositoryAssetService.loadRuleAsset( uid );
        ass.setContent( dt );
        repositoryAssetService.checkinVersion( ass );

        BuilderResult results = repositoryPackageService.buildPackage( pkg.getUUID(),
                                                                       true );
        for ( BuilderResultLine line : results.getLines() ) {
View Full Code Here

        final int PAGE_SIZE = 2;

        UserInbox ib = new UserInbox( rulesRepository );
        ib.clearAll();

        @SuppressWarnings("unused")
        Asset asset;
        String uuid;
        rulesRepository.createModule( "testLoadInboxPackage",
                                      "testLoadInboxDescription" );
        repositoryCategoryService.createCategory( "",
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.rpc.Asset

Copyright © 2018 www.massapicom. 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.