Package org.camunda.bpm.engine

Examples of org.camunda.bpm.engine.ProcessEngineException


    BufferedInputStream inputStream = null;
    try {
      inputStream = new BufferedInputStream(new FileInputStream(getFile(filePath)));
      inputStream.read(buffer);
    } catch(Exception e) {
      throw new ProcessEngineException("Couldn't read file " + filePath + ": " + e.getMessage());
    } finally {
      IoUtil.closeSilently(inputStream);
    }
    return new String(buffer, Charset.forName("UTF-8"));
  }
View Full Code Here


  public static File getFile(String filePath) {
    URL url = IoUtil.class.getClassLoader().getResource(filePath);
    try {
      return new File(url.toURI());
    } catch (Exception e) {
      throw new ProcessEngineException("Couldn't get file " + filePath + ": " + e.getMessage());
    }
  }
View Full Code Here

    try {
      outputStream = new BufferedOutputStream(new FileOutputStream(getFile(filePath)));
      outputStream.write(content.getBytes());
      outputStream.flush();
    } catch(Exception e) {
      throw new ProcessEngineException("Couldn't write file " + filePath, e);
    } finally {
      IoUtil.closeSilently(outputStream);
    }
  }
View Full Code Here

      if (defaultSequenceFlow != null) {
        PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow);
        if (defaultTransition != null) {
          execution.take(defaultTransition);
        } else {
          throw new ProcessEngineException("Default sequence flow '" + defaultSequenceFlow + "' not found");
        }
      } else {
        //No sequence flow could be found, not even a default one
        throw new ProcessEngineException("No outgoing sequence flow of the exclusive gateway '"
              + execution.getActivity().getId() + "' could be selected for continuing the process");
      }
    }
  }
View Full Code Here

  public Object getValue(VariableScope variableScope) {
    return value;
  }

  public void setValue(Object value, VariableScope variableScope) {
    throw new ProcessEngineException("Cannot change fixed value");
  }
View Full Code Here

      log.info("No historyLevel property found in database.");
      dbCreateHistoryLevel(entityManager);
    } else {
      Integer databaseHistoryLevel = new Integer(historyLevelProperty.getValue());
      if (!((Integer) configuredHistoryLevel.getId()).equals(databaseHistoryLevel)) {
        throw new ProcessEngineException("historyLevel mismatch: configuration says " + configuredHistoryLevel + " and database says " + databaseHistoryLevel);
      }
    }
  }
View Full Code Here

      Object object = artifactFactory.getArtifact(clazz);

      applyFieldDeclaration(fieldDeclarations, object);
      return object;
    } catch (Exception e) {
      throw new ProcessEngineException("couldn't instantiate class " + className, e);
    }

  }
View Full Code Here

    if(setterMethod != null) {
      try {
        setterMethod.invoke(target, declaration.getValue());
      } catch (IllegalArgumentException e) {
        throw new ProcessEngineException("Error while invoking '" + declaration.getName() + "' on class " + target.getClass().getName(), e);
      } catch (IllegalAccessException e) {
        throw new ProcessEngineException("Illegal acces when calling '" + declaration.getName() + "' on class " + target.getClass().getName(), e);
      } catch (InvocationTargetException e) {
        throw new ProcessEngineException("Exception while invoking '" + declaration.getName() + "' on class " + target.getClass().getName(), e);
      }
    } else {
      Field field = ReflectUtil.getField(declaration.getName(), target);
      ensureNotNull("Field definition uses unexisting field '" + declaration.getName() + "' on class " + target.getClass().getName(), "field", field);
      // Check if the delegate field's type is correct
      if (!fieldTypeCompatible(declaration, field)) {
        throw new ProcessEngineException("Incompatible type set on field declaration '" + declaration.getName()
          + "' for class " + target.getClass().getName()
          + ". Declared value has type " + declaration.getValue().getClass().getName()
          + ", while expecting " + field.getType().getName());
      }
      ReflectUtil.setField(field, target, declaration.getValue());
View Full Code Here

        // executing the atomic operation makes sure activity start events are fired
        compensatingExecution.performOperation(AtomicOperation.ACTIVITY_START);

      } catch (Exception e) {
        throw new ProcessEngineException("Error while handling compensation event " + eventSubscription, e);
      }

    }
  }
View Full Code Here

  protected boolean isHistoryEnabled = !historyLevel.equals(HistoryLevel.HISTORY_LEVEL_NONE);
  protected boolean isHistoryLevelFullEnabled = historyLevel.equals(HistoryLevel.HISTORY_LEVEL_FULL);

  protected void checkHistoryEnabled() {
    if (!isHistoryEnabled) {
      throw new ProcessEngineException("history is not enabled");
    }
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.ProcessEngineException

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.