Package org.jbpm

Examples of org.jbpm.JbpmException


        query.setParameterList("taskInstanceIds", taskInstanceIds);
        result = CollectionUtil.checkList(query.list(), TaskInstance.class);
      }
      catch (Exception e) {
        handle(e);
        throw new JbpmException("couldn't get task instances by ids '" + taskInstanceIds + "'", e);
      }
    }
    return result;
  }
View Full Code Here


        if (result instanceof Collection) {
          transitionNames = (Collection<?>) result;
        }
      }
      if (transitionNames==null) {
        throw new JbpmException("script for fork '"+name+"' should produce one collection (in one writable variable): "+transitionNames);
      }
    }
   
    // TODO add some way of blocking the current token here and disable that blocking when the join reactivates this token
    // Then an exception can be thrown by in case someone tries to signal a token that is waiting in a fork.
View Full Code Here

          decisionHandler = (DecisionHandler) decisionDelegation.instantiate();

        String transitionName = decisionHandler.decide(executionContext);
        transition = getLeavingTransition(transitionName);
        if (transition == null) {
          throw new JbpmException("decision '"
              + name
              + "' selected non existing transition '"
              + transitionName
              + "'");
        }
      }
      else if (decisionExpression != null) {
        Object result = JbpmExpressionEvaluator.evaluate(decisionExpression, executionContext);
        if (result == null) {
          throw new JbpmException("decision expression '" + decisionExpression + "' returned null");
        }
        String transitionName = result.toString();
        transition = getLeavingTransition(transitionName);
        if (transition == null) {
          throw new JbpmException("decision '"
              + name
              + "' selected non existing transition '"
              + transitionName
              + "'");
        }
      }
      else if (decisionConditions != null && !decisionConditions.isEmpty()) {
        // backwards compatible mode based on separate DecisionCondition's
        for (DecisionCondition decisionCondition : decisionConditions) {
          Object result = JbpmExpressionEvaluator.evaluate(decisionCondition.getExpression(),
              executionContext);
          if (Boolean.TRUE.equals(result)) {
            String transitionName = decisionCondition.getTransitionName();
            transition = getLeavingTransition(transitionName);
            if (transition != null) break;
          }
        }
      }
      else {
        // new mode based on conditions in the transition itself
        for (Transition candidate : leavingTransitions) {
          String conditionExpression = candidate.getCondition();
          if (conditionExpression != null) {
            Object result = JbpmExpressionEvaluator.evaluate(conditionExpression, executionContext);
            if (Boolean.TRUE.equals(result)) {
              transition = candidate;
              break;
            }
          }
        }
      }
    }
    catch (Exception exception) {
      raiseException(exception, executionContext);
      if (!equals(executionContext.getNode())) {
        return;
      }
    }
    finally {
      currentThread.setContextClassLoader(contextClassLoader);
    }

    if (transition == null) {
      transition = getDefaultLeavingTransition();

      if (transition == null)
        throw new JbpmException("decision cannot select transition: " + this);

      log.debug("decision did not select transition, taking default " + transition);
    }

    // since the decision node evaluates condition expressions, the condition of the
View Full Code Here

          log.debug("fetching JbpmSessionFactory from '"+jndiName+"'");
          InitialContext initialContext = new InitialContext();
          Object o = initialContext.lookup(jndiName);
          instance = (JbpmSessionFactory) PortableRemoteObject.narrow(o, JbpmSessionFactory.class);
        } catch (Exception e) {
          throw new JbpmException("couldn't fetch JbpmSessionFactory from jndi '"+jndiName+"'");
        }
       
      } else { // else there is no JNDI name configured
        // create a new default instance.
        log.debug("building singleton JbpmSessionFactory");
View Full Code Here

      String hibernatePropertiesResource = JbpmConfiguration.Configs.getString("resource.hibernate.properties");
      Properties hibernateProperties = new Properties();
      try {
        hibernateProperties.load( ClassLoaderUtil.getStream(hibernatePropertiesResource) );
      } catch (IOException e) {
        throw new JbpmException("couldn't load the hibernate properties from resource '"+hibernatePropertiesResource+"'", e);
      }
      log.debug("overriding hibernate properties with "+ hibernateProperties);
      configuration.setProperties(hibernateProperties);
    }
   
View Full Code Here

     
      dbSession = new JbpmSession( this, session );
     
    } catch (HibernateException e) {
      log.error( e );
      throw new JbpmException( "couldn't create a hibernate persistence session", e );
    }
    return dbSession;
  }
View Full Code Here

    {
      return getClassLoader().loadClass(className);
    }
    catch (ClassNotFoundException e)
    {
      throw new JbpmException("class not found '" + className + "'", e);
    }
  }
View Full Code Here

    {
      return Class.forName(className, false, getClassLoader());
    }
    catch (ClassNotFoundException e)
    {
      throw new JbpmException("class not found '" + className + "'", e);
    }
  }
View Full Code Here

        String classloaderClassname = null;
        try
        {
          if (!JbpmConfiguration.Configs.hasObject("jbpm.customClassLoader.className"))
          {
            throw new JbpmException(
                "'jbpm.classLoader' property set to 'custom' but 'jbpm.customClassLoader.className' is absent!");
          }
          classloaderClassname = JbpmConfiguration.Configs
              .getString("jbpm.customClassLoader.className");
          if (classloaderClassname == null)
          {
            throw new JbpmException(
                "'jbpm.classloader' property set to 'custom' but 'jbpm.customClassLoader.className' is null!");
          }

          Class<?> clazz = Class.forName(classloaderClassname, false, ClassLoaderUtil.class.getClassLoader());
          if (clazz == null) {
            clazz = Class.forName(classloaderClassname, false, Thread.currentThread().getContextClassLoader());
          }

          return (ClassLoader) clazz.newInstance();
        }
        catch (InstantiationException e)
        {
          throw new JbpmException("Error instantiating custom classloader "
              + classloaderClassname, e);
        }
        catch (IllegalAccessException e)
        {
          throw new JbpmException("Error accessing custom classloader " + classloaderClassname,
              e);
        }
        catch (ClassNotFoundException e)
        {
          throw new JbpmException("Custom classloader " + classloaderClassname + " not found ",
              e);
        }
      }
      else
      {
        throw new JbpmException("'jbpm.classloader' property set to '"
            + jbpmClassloader
            + "' but only the values 'jbpm'/'context'/'custom' are supported!");
      }
    }
    else
View Full Code Here

      properties.load(inStream);
      inStream.close();
    }
    catch (IOException e)
    {
      throw new JbpmException("couldn't load properties file '" + resource + "'", e);
    }
    return properties;
  }
View Full Code Here

TOP

Related Classes of org.jbpm.JbpmException

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.