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

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

Best Java code snippets using org.drools.repository.ModuleItem.getUUID (Showing top 9 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.chtijbug.drools/guvnor-repository

  return itemOriginal.getUUID();
} catch (RepositoryException e) {
  log.error(e.getMessage(),
origin: org.chtijbug.drools/guvnor-repository

/**
 * Copy a package to the target name.
 */
public String copyModule(String sourceModuleName,
             String destModuleName) {
  ModuleItem source = loadModule(sourceModuleName);
  try {
    String destPath = source.getNode().getParent().getPath() + "/" + destModuleName;
    if (this.getAreaNode(MODULE_AREA).hasNode(destModuleName)) {
      throw new RulesRepositoryException("Destination already exists.");
    }
    this.session.getWorkspace().copy(source.getNode().getPath(),
        destPath);
    ModuleItem newModuleItem = loadModule(destModuleName);
    newModuleItem.updateTitle(destModuleName);
    for (Iterator iter = newModuleItem.getAssets(); iter.hasNext(); ) {
      AssetItem as = (AssetItem) iter.next();
      as.updateStringProperty(destModuleName,
          AssetItem.MODULE_NAME_PROPERTY);
    }
    save();
    return newModuleItem.getUUID();
  } catch (RepositoryException e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}

origin: org.drools/guvnor-repository

  return itemOriginal.getUUID();
} catch (RepositoryException e) {
  log.error(e.getMessage(),
origin: org.drools/guvnor-repository

/**
 * Copy a package to the target name.
 */
public String copyModule(String sourceModuleName,
             String destModuleName) {
  ModuleItem source = loadModule(sourceModuleName);
  try {
    String destPath = source.getNode().getParent().getPath() + "/" + destModuleName;
    if (this.getAreaNode(MODULE_AREA).hasNode(destModuleName)) {
      throw new RulesRepositoryException("Destination already exists.");
    }
    this.session.getWorkspace().copy(source.getNode().getPath(),
        destPath);
    ModuleItem newModuleItem = loadModule(destModuleName);
    newModuleItem.updateTitle(destModuleName);
    for (Iterator iter = newModuleItem.getAssets(); iter.hasNext(); ) {
      AssetItem as = (AssetItem) iter.next();
      as.updateStringProperty(destModuleName,
          AssetItem.MODULE_NAME_PROPERTY);
    }
    save();
    return newModuleItem.getUUID();
  } catch (RepositoryException e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}

origin: org.chtijbug.drools/guvnor-repository

@Test
public void testGetPackageItem() throws Exception {
  RulesRepository repo = getRepo();
  ModuleItem def = repo.loadDefaultModule();
  AssetItem asset = repo.loadDefaultModule().addAsset("testPackageItem", "test content");
  ModuleItem pkg = asset.getModule();
  assertEquals(def.getName(), pkg.getName());
  assertEquals(def.getUUID(), pkg.getUUID());
}
origin: org.chtijbug.drools/guvnor-repository

ModuleItem dest = repo.loadModule( "testCopyPackage2" );
assertNotNull( dest );
assertFalse( source.getUUID().equals( dest.getUUID() ) );
origin: org.chtijbug.drools/guvnor-repository

assertEquals(loadGlobalArea().getUUID(), ruleItem.getModule().getUUID());
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testRenamePackage() throws Exception {
  RulesRepository repo = getRepo();
  ModuleItem original = repo.createModule( "testRenamePackage",
                        "asset" );
  List packagesOriginal = iteratorToList( repo.listModules() );
  AssetItem item = repo.loadModule( "testRenamePackage" ).addAsset( "testRenameAssetSource",
                                    "desc" );
  item.updateContent( "la" );
  item.checkin( "" );
  String uuid = repo.renameModule( original.getUUID(),
                   "testRenamePackage2" );
  ModuleItem pkg = repo.loadModuleByUUID( uuid );
  assertEquals( "testRenamePackage2",
         pkg.getName() );
  List assets = iteratorToList( repo.loadModule( "testRenamePackage2" ).getAssets() );
  assertEquals( 1,
         assets.size() );
  item = (AssetItem) assets.get( 0 );
  assertEquals( "testRenameAssetSource",
         item.getName() );
  assertEquals( "la",
         item.getContent() );
  assertEquals( "testRenamePackage2",
         item.getModuleName() );
  List packageFinal = iteratorToList( repo.listModules() );
  assertEquals( packagesOriginal.size(),
         packageFinal.size() );
}
origin: org.chtijbug.drools/guvnor-repository

assertEquals("testPackageSnapshot", pkgLoaded.getName());
ModuleItem _pkgLoaded = repo.loadModuleByUUID( pkgLoaded.getUUID() );
assertNotNull(_pkgLoaded);
assertEquals(pkgLoaded.getCreatedDate(), _pkgLoaded.getCreatedDate());
List snapAssets = iteratorToList( pkg2.getAssets() );
assertEquals(2, snapAssets.size());
assertFalse(pkg2.getUUID().equals( pkg.getUUID() ));
assertTrue(snapAssets.get( 0 ) instanceof AssetItem);
assertTrue(snapAssets.get( 1 ) instanceof AssetItem);
org.drools.repositoryModuleItemgetUUID

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,
  • getAssetsWithStatus,
  • getDependencies,
  • getDescription,
  • getFormat,
  • getLastModified,
  • getNode,
  • getStringPropertyArray

Popular in Java

  • Updating database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • getSystemService (Context)
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • BigInteger (java.math)
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • IsNull (org.hamcrest.core)
    Is the value null?
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