Package org.jbpm.module.exe

Examples of org.jbpm.module.exe.ModuleInstance


    {
      instances = new HashMap<String, ModuleInstance>();
      // loop over each optional definition
      for (ModuleDefinition definition : definitions.values()) {
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null)
        {
          addInstance(instance);
        }       
      }
View Full Code Here


  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance)
  {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null)
      throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null)
    {
      removedModuleInstance = instances.remove(moduleInstance.getClass().getName());
View Full Code Here

      // loop over each optional definition
      Iterator iter = definitions.values().iterator();
      while (iter.hasNext()) {
        ModuleDefinition definition = (ModuleDefinition) iter.next();
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null) {
          addInstance( instance );
        }
      }
    }
View Full Code Here

  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance) {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null) throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null) {
      removedModuleInstance = (ModuleInstance) instances.remove(moduleInstance.getClass().getName());
      if (removedModuleInstance!=null) {
        moduleInstance.setProcessInstance(null);
View Full Code Here

  /**
   * looks up an optional module instance by its class.   
   */
  public ModuleInstance getInstance(Class clazz) {
    ModuleInstance moduleInstance = null;
    if ( instances != null ) {
      moduleInstance = (ModuleInstance) instances.get( clazz.getName() );
    }
   
    if (moduleInstance==null) {
      if (transientInstances==null) transientInstances = new HashMap();
     
      // client requested an instance that is not in the map of instances.
      // so we can safely assume that the client wants a transient instance
      moduleInstance = (ModuleInstance) transientInstances.get( clazz.getName() );
      if (moduleInstance==null) {
        try {
          moduleInstance = (ModuleInstance) clazz.newInstance();
          moduleInstance.setProcessInstance(this);

        } catch (Exception e) {
          e.printStackTrace();
          throw new JbpmException("couldn't instantiate transient module '"+clazz.getName()+"' with the default constructor");
        }
View Full Code Here

      // loop over each optional definition
      Iterator iter = definitions.values().iterator();
      while (iter.hasNext()) {
        ModuleDefinition definition = (ModuleDefinition) iter.next();
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null) {
          addInstance( instance );
        }
      }
    }
View Full Code Here

  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance) {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null) throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null) {
      removedModuleInstance = (ModuleInstance) instances.remove(moduleInstance.getClass().getName());
      if (removedModuleInstance!=null) {
        moduleInstance.setProcessInstance(null);
View Full Code Here

  /**
   * looks up an optional module instance by its class.   
   */
  public ModuleInstance getInstance(Class clazz) {
    ModuleInstance moduleInstance = null;
    if ( instances != null ) {
      moduleInstance = (ModuleInstance) instances.get( clazz.getName() );
    }
   
    if (moduleInstance==null) {
      if (transientInstances==null) transientInstances = new HashMap();
     
      // client requested an instance that is not in the map of instances.
      // so we can safely assume that the client wants a transient instance
      moduleInstance = (ModuleInstance) transientInstances.get( clazz.getName() );
      if (moduleInstance==null) {
        try {
          moduleInstance = (ModuleInstance) clazz.newInstance();
          moduleInstance.setProcessInstance(this);

        } catch (Exception e) {
          e.printStackTrace();
          throw new JbpmException("couldn't instantiate transient module '"+clazz.getName()+"' with the default constructor");
        }
View Full Code Here

      // loop over each optional definition
      Iterator iter = definitions.values().iterator();
      while (iter.hasNext()) {
        ModuleDefinition definition = (ModuleDefinition) iter.next();
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null) {
          addInstance( instance );
        }
      }
    }
View Full Code Here

  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance) {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null) throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null) {
      removedModuleInstance = (ModuleInstance) instances.remove(moduleInstance.getClass().getName());
      if (removedModuleInstance!=null) {
        moduleInstance.setProcessInstance(null);
View Full Code Here

TOP

Related Classes of org.jbpm.module.exe.ModuleInstance

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.