Package org.drools.guvnor.server.selector

Examples of org.drools.guvnor.server.selector.AssetSelector


        rule2.updateContent("when \n Person() \n then \n System.out.println(\"yeah\");\n");
        rule2.checkin("");

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put("testSelect",
                new AssetSelector() {
                    public boolean isAssetAllowed(AssetItem asset) {
                        return asset.getName().equals("rule2");
                    }
                });
View Full Code Here


        rule2.updateContent("when \n Person() \n then \n System.out.println(\"yeah\");\n");
        rule2.checkin("");

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put("testSelect",
                new AssetSelector() {
                    public boolean isAssetAllowed(AssetItem asset) {
                        return asset.getName().equals("rule2");
                    }
                });
View Full Code Here

        rule2.updateContent( "when \n Person() \n then \n System.out.println(\"yeah\");\n" );
        rule2.checkin( "" );

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put( "testSelect",
                          new AssetSelector() {
                              public boolean isAssetAllowed(AssetItem asset) {
                                  return asset.getName().equals( "rule2" );
                              }
                          } );
View Full Code Here

        rule2.updateContent("when \n Person() \n then \n System.out.println(\"yeah\");\n");
        rule2.checkin("");

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put("testSelect",
                new AssetSelector() {
                    public boolean isAssetAllowed(AssetItem asset) {
                        return asset.getName().equals("rule2");
                    }
                });
View Full Code Here

    /**
   * This will build the package - preparePackage would have been called first.
     * This will always prioritise DRL before other assets.
   */
  private void buildPackage() {
    AssetSelector selector = null;
    if("customSelector".equals(buildMode)) {
      selector = SelectorManager.getInstance().getSelector(customSelectorName);     
    } else if ("builtInSelector".equals(buildMode)) {
      selector = (BuiltInSelector)SelectorManager.getInstance().getSelector(
      "BuiltInSelector");
          ((BuiltInSelector)selector).setStatusOperator(statusOperator);
          ((BuiltInSelector)selector).setStatus(statusDescriptionValue)
          ((BuiltInSelector)selector).setEnableStatusSelector(enableStatusSelector);
          ((BuiltInSelector)selector).setCategory(categoryValue);
          ((BuiltInSelector)selector).setCategoryOperator(categoryOperator);
          ((BuiltInSelector)selector).setEnableCategorySelector(enableCategorySelector);
    } else {
      //return the NilSelector, i.e., allows everything
      selector = SelectorManager.getInstance().getSelector(null);       
    }
   
    if (selector == null) {
      this.errors.add(new ContentAssemblyError(this.pkg,
          "The selector named " + customSelectorName
              + " is not available."));
      return;
    }
       
    StringBuffer includedAssets = new StringBuffer("Following assets have been included in package build: ");
        Iterator<AssetItem> drls = pkg.listAssetsByFormat(new String[]{AssetFormats.DRL});
        while (drls.hasNext()) {
            AssetItem asset = (AssetItem) drls.next();
            if (!asset.isArchived() && (selector.isAssetAllowed(asset))) {
                buildAsset(asset);
                includedAssets.append(asset.getName() + ", ");
            }
        }
    Iterator<AssetItem> it = pkg.getAssets();
    while (it.hasNext()) {
      AssetItem asset = (AssetItem) it.next();
      if (!asset.getFormat().equals(AssetFormats.DRL) && !asset.isArchived() && (selector.isAssetAllowed(asset))) {
        buildAsset(asset);
              includedAssets.append(asset.getName() + ", ");
      }
    }
    log.info(includedAssets.toString());
View Full Code Here

        rule2.updateContent( "when \n Person() \n then \n System.out.println(\"yeah\");\n" );
        rule2.checkin( "" );

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put( "testSelect",
                          new AssetSelector() {
                              public boolean isAssetAllowed(AssetItem asset) {
                                  return asset.getName().equals( "rule2" );
                              }
                          } );
View Full Code Here

        rule2.updateContent( "when \n Person() \n then \n System.out.println(\"yeah\");\n" );
        rule2.checkin( "" );

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put( "testSelect",
                          new AssetSelector() {
                              public boolean isAssetAllowed(AssetItem asset) {
                                  return asset.getName().equals( "rule2" );
                              }
                          } );
View Full Code Here

        rule2.updateContent( "when \n Person() \n then \n System.out.println(\"yeah\");\n" );
        rule2.checkin( "" );

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put( "testSelect",
                          new AssetSelector() {
                              public boolean isAssetAllowed(AssetItem asset) {
                                  return asset.getName().equals( "rule2" );
                              }
                          } );
View Full Code Here

    /**
   * This will build the package - preparePackage would have been called first.
     * This will always prioritise DRL before other assets.
   */
  private void buildPackage() {
    AssetSelector selector = null;
    if("customSelector".equals(buildMode)) {
      selector = SelectorManager.getInstance().getSelector(customSelectorName);     
    } else if ("builtInSelector".equals(buildMode)) {
      selector = (BuiltInSelector)SelectorManager.getInstance().getSelector(
      "BuiltInSelector");
          ((BuiltInSelector)selector).setStatusOperator(statusOperator);
          ((BuiltInSelector)selector).setStatus(statusDescriptionValue)
          ((BuiltInSelector)selector).setEnableStatusSelector(enableStatusSelector);
          ((BuiltInSelector)selector).setCategory(categoryValue);
          ((BuiltInSelector)selector).setCategoryOperator(categoryOperator);
          ((BuiltInSelector)selector).setEnableCategorySelector(enableCategorySelector);
    } else {
      //return the NilSelector, i.e., allows everything
      selector = SelectorManager.getInstance().getSelector(null);       
    }
   
    if (selector == null) {
      this.errors.add(new ContentAssemblyError(this.pkg,
          "The selector named " + customSelectorName
              + " is not available."));
      return;
    }
       
    StringBuffer includedAssets = new StringBuffer("Following assets have been included in package build: ");
        Iterator<AssetItem> drls = pkg.listAssetsByFormat(new String[]{AssetFormats.DRL});
        while (drls.hasNext()) {
            AssetItem asset = (AssetItem) drls.next();
            if (!asset.isArchived() && (selector.isAssetAllowed(asset))) {
                buildAsset(asset);
                includedAssets.append(asset.getName() + ", ");
            }
        }
    Iterator<AssetItem> it = pkg.getAssets();
    while (it.hasNext()) {
      AssetItem asset = (AssetItem) it.next();
      if (!asset.getFormat().equals(AssetFormats.DRL) && !asset.isArchived() && (selector.isAssetAllowed(asset))) {
        buildAsset(asset);
              includedAssets.append(asset.getName() + ", ");
      }
    }
    log.info(includedAssets.toString());
View Full Code Here

        rule2.updateContent( "when \n Person() \n then \n System.out.println(\"yeah\");\n" );
        rule2.checkin( "" );

        SelectorManager sm = SelectorManager.getInstance();
        sm.selectors.put( "testSelect",
                          new AssetSelector() {
                              public boolean isAssetAllowed(AssetItem asset) {
                                  return asset.getName().equals( "rule2" );
                              }
                          } );
View Full Code Here

TOP

Related Classes of org.drools.guvnor.server.selector.AssetSelector

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.