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

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTable (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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