Package org.camunda.bpm.engine

Examples of org.camunda.bpm.engine.ProcessEngineException


  public String getJPAClassString(Object value) {
    ensureNotNull("null value cannot be saved", "value", value);
   
    EntityMetaData metaData = getEntityMetaData(value.getClass());
    if(!metaData.isJPAEntity()) {
      throw new ProcessEngineException("Object is not a JPA Entity: class='" + value.getClass() + "', " + value);
    }
   
    // Extract the ID from the Entity instance using the metaData
    return metaData.getEntityClass().getName();
  }
View Full Code Here


  }
 
  public String getJPAIdString(Object value) {
    EntityMetaData metaData = getEntityMetaData(value.getClass());
    if(!metaData.isJPAEntity()) {
      throw new ProcessEngineException("Object is not a JPA Entity: class='" + value.getClass() + "', " + value);
    }
    Object idValue = getIdValue(value, metaData);
    return getIdString(idValue);
  }
View Full Code Here

        return metaData.getIdMethod().invoke(value);
      } else if (metaData.getIdField() != null) {
        return metaData.getIdField().get(value);
      }
    } catch (IllegalArgumentException iae) {
      throw new ProcessEngineException("Illegal argument exception when getting value from id method/field on JPAEntity", iae);
    } catch (IllegalAccessException iae) {
      throw new ProcessEngineException("Cannot access id method/field for JPA Entity", iae);
    } catch (InvocationTargetException ite) {
      throw new ProcessEngineException("Exception occured while getting value from id field/method on JPAEntity: " +
        ite.getCause().getMessage(), ite.getCause());
    }
   
    // Fall trough when no method and field is set
    throw new ProcessEngineException("Cannot get id from JPA Entity, no id method/field set");
  }
View Full Code Here

    } else if(type == BigDecimal.class) {
      return new BigDecimal(string);
    } else if(type == BigInteger.class) {
      return new BigInteger(string);
    } else {
      throw new ProcessEngineException("Unsupported Primary key type for JPA-Entity: " + type.getName());
    }
  }
View Full Code Here

      || value instanceof Short || value instanceof Integer || value instanceof Float
      || value instanceof Double || value instanceof Character || value instanceof BigDecimal
      || value instanceof BigInteger) {
      return value.toString();
    } else {
      throw new ProcessEngineException("Unsupported Primary key type for JPA-Entity: " + value.getClass().getName());
    }
  }
View Full Code Here

  public void flush() {
    if (entityManager != null && (!handleTransactions || isTransactionActive()) ) {
      try {
        entityManager.flush();
      } catch (IllegalStateException ise) {
        throw new ProcessEngineException("Error while flushing EntityManager, illegal state", ise);
      } catch (TransactionRequiredException tre) {
        throw new ProcessEngineException("Cannot flush EntityManager, an active transaction is required", tre);
      } catch (PersistenceException pe) {
        throw new ProcessEngineException("Error while flushing EntityManager: " + pe.getMessage(), pe);
      }
    }
  }
View Full Code Here

  public void close() {
    if (closeEntityManager && entityManager != null && !entityManager.isOpen()) {
      try {
        entityManager.close();
      } catch (IllegalStateException ise) {
        throw new ProcessEngineException("Error while closing EntityManager, may have already been closed or it is container-managed", ise);
      }
    }
  }
View Full Code Here

  public void execute(DelegateExecution execution) throws Exception {

    Boolean shouldFail = (Boolean) execution.getVariable("shouldFail");
    if(shouldFail != null && shouldFail) {
      throw new ProcessEngineException("Could not archive invoice...");
    }
    else {
      LOGGER.info("\n\n  ... Now archiving invoice "+execution.getVariable("invoiceNumber")+" \n\n");
    }
View Full Code Here

    return this;
  }

  public HistoricActivityInstanceQueryImpl completeScope() {
    if (activityInstanceState != null) {
      throw new ProcessEngineException("Already querying for activity instance state <" + activityInstanceState + ">");
    }

    this.activityInstanceState = ActivityInstanceState.SCOPE_COMPLETE;
    return this;
  }
View Full Code Here

    return this;
  }

  public HistoricActivityInstanceQueryImpl canceled() {
    if (activityInstanceState != null) {
      throw new ProcessEngineException("Already querying for activity instance state <" + activityInstanceState + ">");
    }
    this.activityInstanceState = ActivityInstanceState.CANCELED;
    return this;
  }
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.