Codota Logo
ModuleItem.getAssetsWithStatus
Code IndexAdd Codota to your IDE (free)

How to use
getAssetsWithStatus
method
in
org.drools.repository.ModuleItem

Best Java code snippets using org.drools.repository.ModuleItem.getAssetsWithStatus (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.drools/guvnor-repository

/**
 * This will return a list of assets for a given state. It works through the
 * assets that belong to this module, and if they are not in the correct
 * state, walks backwards until it finds one in the correct state.
 * <p/>
 * If it walks all the way back up the versions looking for the "latest"
 * version with the appropriate state, and can't find one, that asset is not
 * included in the result.
 */
public Iterator<AssetItem> getAssetsWithStatus(final StateItem state) {
  return getAssetsWithStatus(state,
      null);
}
origin: org.chtijbug.drools/guvnor-repository

/**
 * This will return a list of assets for a given state. It works through the
 * assets that belong to this module, and if they are not in the correct
 * state, walks backwards until it finds one in the correct state.
 * <p/>
 * If it walks all the way back up the versions looking for the "latest"
 * version with the appropriate state, and can't find one, that asset is not
 * included in the result.
 */
public Iterator<AssetItem> getAssetsWithStatus(final StateItem state) {
  return getAssetsWithStatus(state,
      null);
}
origin: org.chtijbug.drools/guvnor-repository

rules = iteratorToList( pack.getAssetsWithStatus(state) );
rules = iteratorToList( pack.getAssetsWithStatus( getRepo().getState( "whee" ) ) );
assertEquals(0, rules.size());
rules = iteratorToList( pack.getAssetsWithStatus(getRepo().getState( StateItem.DRAFT_STATE_NAME )) );
assertEquals(3, rules.size());
rule1.checkin( "latest" );
rules = iteratorToList( pack.getAssetsWithStatus(getRepo().getState( "extractorState" )) );
assertEquals(1, rules.size());
AssetItem rule = (AssetItem) rules.get( 0 );
rules = iteratorToList( pack.getAssetsWithStatus(getRepo().getState( "foobar" )) );
assertEquals(1, rules.size());
AssetItem prior = (AssetItem) rules.get( 0 );
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testIgnoreState() throws Exception {
  ModuleItem pack = getRepo().createModule( "package testIgnoreState", "foo" );
  getRepo().createState( "x" );
  AssetItem rule1 = pack.addAsset( "rule number 1", "yeah man" );
  rule1.updateState( "x" );
  rule1.checkin( "version0" );
  AssetItem rule2 = pack.addAsset( "rule number 2", "no way" );
  rule2.updateState( "x" );
  rule2.checkin( "version0" );
  AssetItem rule3 = pack.addAsset( "rule number 3", "yes way" );
  getRepo().createState( "disabled" );
  rule3.updateState( "disabled" );
  rule3.checkin( "version0" );
  getRepo().save();
  Iterator result = pack.getAssetsWithStatus( getRepo().getState( "x" ), getRepo().getState( "disabled" ) );
  List l = iteratorToList( result );
  assertEquals(2, l.size());
}
org.drools.repositoryModuleItemgetAssetsWithStatus

Javadoc

This will return a list of assets for a given state. It works through the assets that belong to this module, and if they are not in the correct state, walks backwards until it finds one in the correct state.

If it walks all the way back up the versions looking for the "latest" version with the appropriate state, and can't find one, that asset is not included in the result.

Popular methods of ModuleItem

  • addAsset
    This adds an asset to the current physical module (you can move it later). With the given category.
  • containsAsset
    Returns true if this module contains an asset of the given name.
  • getName
    Return the name of the module.
  • getStringProperty
  • listAssetsByFormat
    This will load an iterator for assets of the given format type.
  • loadAsset
    Load a specific asset by name.
  • updateStringProperty
  • <init>
    Constructs an object of type ModuleItem corresponding the specified node
  • checkin
  • checkout
  • createSubModule
    Creates a nested package.
  • ensureMixinType
  • createSubModule,
  • ensureMixinType,
  • getAssets,
  • getDependencies,
  • getDescription,
  • getFormat,
  • getLastModified,
  • getNode,
  • getStringPropertyArray

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now