Package org.drools.guvnor.client.factmodel

Examples of org.drools.guvnor.client.factmodel.FactModels


    @Override
    public void retrieveAssetContent(RuleAsset asset,
                                     AssetItem item) throws SerializationException {
        try {
            List<FactMetaModel> models = toModel( item.getContent() );
            FactModels ms = new FactModels();
            ms.models = models;
            asset.setContent( ms );
        } catch ( DroolsParserException e ) {
            log.error( "Unable to parse the DRL for the model - falling back to text (" + e.getMessage() + ")" );
            RuleContentText text = new RuleContentText();
View Full Code Here


    @Override
    public void storeAssetContent(RuleAsset asset,
                                  AssetItem repoAsset)
                                                      throws SerializationException {
        if ( asset.getContent() instanceof FactModels ) {
            FactModels fm = (FactModels) asset.getContent();
            repoAsset.updateContent( toDRL( fm.models ) );
        } else {
            RuleContentText text = (RuleContentText) asset.getContent();
            repoAsset.updateContent( text.content );
        }
View Full Code Here

    }

    public void assembleSource(PortableObject assetContent,
                               StringBuilder stringBuilder) {
        FactModels fms = (FactModels) assetContent;
        for ( FactMetaModel fm : fms.models ) {
            stringBuilder.append( toDRL( fm ) );
            stringBuilder.append( "\n\n" );
        }
    }
View Full Code Here

        RuleAsset ass = new RuleAsset();
        ch.retrieveAssetContent( ass,
                                 asset );
        assertTrue( ass.content instanceof FactModels );
        FactModels fm = (FactModels) ass.content;

        assertEquals( 1,
                      fm.models.size() );
        FactMetaModel mm = (FactMetaModel) fm.models.get( 0 );
        assertEquals( 1,
View Full Code Here

      asset.checkin("");

      RuleAsset ass = new RuleAsset();
      ch.retrieveAssetContent(ass, pkg, asset);
      assertTrue(ass.content instanceof FactModels);
      FactModels fm = (FactModels) ass.content;

      assertEquals(1, fm.models.size());
      FactMetaModel mm = (FactMetaModel) fm.models.get(0);
      assertEquals(1, mm.fields.size());
      assertEquals("Foo", mm.name);
View Full Code Here

        RuleAsset ass = new RuleAsset();
        ch.retrieveAssetContent( ass,
                                 pkg,
                                 asset );
        assertTrue( ass.content instanceof FactModels );
        FactModels fm = (FactModels) ass.content;

        assertEquals( 1,
                      fm.models.size() );
        FactMetaModel mm = (FactMetaModel) fm.models.get( 0 );
        assertEquals( 1,
View Full Code Here

        RuleAsset ass = new RuleAsset();
        ch.retrieveAssetContent( ass,
                                 asset );
        assertTrue( ass.getContent() instanceof FactModels );
        FactModels fm = (FactModels) ass.getContent();

        assertEquals( 1,
                      fm.models.size() );
        FactMetaModel mm = (FactMetaModel) fm.models.get( 0 );
        assertEquals( 1,
View Full Code Here

    @Override
    public void retrieveAssetContent(RuleAsset asset,
            AssetItem item) throws SerializationException {
        try {
            List<FactMetaModel> models = toModel( item.getContent() );
            FactModels ms = new FactModels();
            ms.models = models;
            asset.content = ms;
        } catch ( DroolsParserException e ) {
            log.error( "Unable to parse the DRL for the model - falling back to text (" + e.getMessage() + ")" );
            RuleContentText text = new RuleContentText();
View Full Code Here

    @Override
    public void storeAssetContent(RuleAsset asset,
                                  AssetItem repoAsset)
                                                      throws SerializationException {
        if ( asset.content instanceof FactModels ) {
            FactModels fm = (FactModels) asset.content;
            repoAsset.updateContent( toDRL( fm.models ) );
        } else {
            RuleContentText text = (RuleContentText) asset.content;
            repoAsset.updateContent( text.content );
        }
View Full Code Here

  @Override
  public void retrieveAssetContent(RuleAsset asset, PackageItem pkg,
      AssetItem item) throws SerializationException {
    try {
      List<FactMetaModel> models = toModel(item.getContent());
      FactModels ms = new FactModels();
      ms.models = models;
      asset.content = ms;
    } catch (DroolsParserException e) {
      System.err.println("Unable to parse the DRL for the model - falling back to text (" + e.getMessage() + ")");
      RuleContentText text = new RuleContentText();
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.factmodel.FactModels

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.