Tabnine Logo
RulesRepository.loadState
Code IndexAdd Tabnine to your IDE (free)

How to use
loadState
method
in
org.drools.repository.RulesRepository

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

origin: org.drools/guvnor-repository

public void renameState(String oldName,
            String newName) {
  try {
    StateItem state = loadState(oldName);
    Node node = state.getNode();
    String sourcePath = node.getPath();
    String destPath = node.getParent().getPath() + "/" + newName;
    this.session.move(sourcePath,
        destPath);
    save();
  } catch (RepositoryException e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

public void renameState(String oldName,
            String newName) {
  try {
    StateItem state = loadState(oldName);
    Node node = state.getNode();
    String sourcePath = node.getPath();
    String destPath = node.getParent().getPath() + "/" + newName;
    this.session.move(sourcePath,
        destPath);
    save();
  } catch (RepositoryException e) {
    log.error(e.getMessage(),
        e);
    throw new RulesRepositoryException(e);
  }
}
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testRemoveState() {
  RulesRepository repo = getRepo();
  StateItem[] items = repo.listStates();
  assertTrue( items.length > 0 );
  final String name = "stateThatHasALongNameAndWillBeRenamed";
  repo.createState( name );
  StateItem[] items2 = repo.listStates();
  assertEquals( items.length + 1,
         items2.length );
  repo.loadState( name ).remove();
  repo.save();
  StateItem[] items3 = repo.listStates();
  assertEquals( items2.length -1,
         items3.length );
  try {
    repo.loadState( name );
    fail( "Should never be here. Removed state still exists." );
  } catch ( RulesRepositoryException e ) {
    // Works
  }
}
/*
origin: org.chtijbug.drools/guvnor-repository

@Test
public void testRenameState() {
  RulesRepository repo = getRepo();
  StateItem[] items = repo.listStates();
  assertTrue( items.length > 0 );
  final String oldName = "stateThatHasALongNameAndWillBeRenamed";
  repo.createState( oldName );
  StateItem[] items2 = repo.listStates();
  assertEquals( items.length + 1,
         items2.length );
  final String newName = "stateThatHasALongNameAndWillBeRenamedNameAfterTheRenaming";
  repo.renameState( oldName,
           newName );
  StateItem[] items3 = repo.listStates();
  assertEquals( items2.length,
         items3.length );
  try {
    repo.loadState( oldName );
    fail( "Should never be here. Old name is still used." );
  } catch ( RulesRepositoryException e ) {
    // Works
  }
  assertNotNull( repo.loadState( newName ) );
}
org.drools.repositoryRulesRepositoryloadState

Popular methods of RulesRepository

  • createModule
    Adds a module to the repository.
  • loadModule
    Loads a Module for the specified module name and version. Will throw an exception if the specified m
  • save
    Save any pending changes.
  • <init>
    This requires a JCR session be setup, and the repository be configured.
  • findAssetsByCategory
    This will retrieve a list of RuleItem objects - that are allocated to the provided category. Only th
  • findAssetsByName
    This will search assets, looking for matches against the name.
  • findAssetsByState
    Finds the AssetItem's linked to the requested state. Similar to finding by category.
  • getAreaNode
  • getSession
  • getState
    Gets a StateItem for the specified state name. If a node for the specified state does not yet exist,
  • listModuleSnapshots
    Return a list of the snapshots available for the given module name.
  • listModules
  • listModuleSnapshots,
  • listModules,
  • loadAssetByUUID,
  • loadCategory,
  • loadGlobalArea,
  • loadModuleByUUID,
  • loadModuleSnapshot,
  • addNodeIfNew,
  • checkForDataMigration

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • ImageIO (javax.imageio)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now