Package org.activiti.engine

Examples of org.activiti.engine.ActivitiException


  public TableMetaData getTableMetaData() {
    if(authenticate(SecuredResource.ADMIN) == false) return null;
   
    String tableName = (String) getRequest().getAttributes().get("tableName");
    if(tableName == null) {
      throw new ActivitiException("table name is required");
    }
    return ActivitiUtil.getManagementService().getTableMetaData(tableName);
  }
View Full Code Here


      } finally {
        tables.close();
      }
     
    } catch (Exception e) {
      throw new ActivitiException("couldn't check if tables are already present using metadata: "+e.getMessage(), e);
    }
  }
View Full Code Here

    }
    Double cleanDbVersion = getCleanVersion(versionInDatabase);
    Double cleanEngineVersion = getCleanVersion(ProcessEngine.VERSION);
     
    if(cleanDbVersion.compareTo(cleanEngineVersion) > 0) {
      throw new ActivitiException("Version of activiti database (" + versionInDatabase + ") is more recent than the engine (" + ProcessEngine.VERSION +")");
    } else if(cleanDbVersion.compareTo(cleanEngineVersion) == 0) {
      // Versions don't match exactly, possibly snapshot is being used
      log.warning("Engine-version is the same, but not an exact match: " + versionInDatabase + " vs. " + ProcessEngine.VERSION
              + ". Not performing database-upgrade.");
      return false;
View Full Code Here

  }

  protected Double getCleanVersion(String versionString) {
    Matcher matcher = CLEAN_VERSION_REGEX.matcher(versionString);
    if(!matcher.find()) {
      throw new ActivitiException("Illegal format for version: " + versionString);
    }
   
    String cleanString = matcher.group();
    try {
      return Double.parseDouble(cleanString);
    } catch(NumberFormatException nfe) {
      throw new ActivitiException("Illegal format for version: " + versionString);
    }
  }
View Full Code Here

      inputStream = ReflectUtil.getResourceAsStream(resourceName);
      if (inputStream == null) {
        if (isOptional) {
          log.fine("no schema resource "+resourceName+" for "+operation);
        } else {
          throw new ActivitiException("resource '" + resourceName + "' is not available");
        }
      } else {
        executeSchemaResource(operation, component, resourceName, inputStream);
      }
View Full Code Here

          String upgradestepClassName = line.substring(13).trim();
          DbUpgradeStep dbUpgradeStep = null;
          try {
            dbUpgradeStep = (DbUpgradeStep) ReflectUtil.instantiate(upgradestepClassName);
          } catch (ActivitiException e) {
            throw new ActivitiException("database update java class '"+upgradestepClassName+"' can't be instantiated: "+e.getMessage(), e);
          }
          try {
            log.fine("executing upgrade step java class "+upgradestepClassName);
            dbUpgradeStep.execute(this);
          } catch (Exception e) {
            throw new ActivitiException("error while executing database update java class '"+upgradestepClassName+"': "+e.getMessage(), e);
          }
         
        } else if (line.length()>0) {
         
          if (line.endsWith(";")) {
            sqlStatement = addSqlStatementPiece(sqlStatement, line.substring(0, line.length()-1));
            Statement jdbcStatement = connection.createStatement();
            try {
              // no logging needed as the connection will log it
              log.fine("SQL: "+sqlStatement);
              jdbcStatement.execute(sqlStatement);
              jdbcStatement.close();
            } catch (Exception e) {
              if (exception == null) {
                exception = e;
                exceptionSqlStatement = sqlStatement;
              }
              log.log(Level.SEVERE, "problem during schema " + operation + ", statement '" + sqlStatement, e);
            } finally {
              sqlStatement = null;
            }
          } else {
            sqlStatement = addSqlStatementPiece(sqlStatement, line);
          }
        }
       
        line = readNextTrimmedLine(reader);
      }

      if (exception != null) {
        throw exception;
      }
     
      log.fine("activiti db schema " + operation + " for component "+component+" successful");
     
    } catch (Exception e) {
      throw new ActivitiException("couldn't "+operation+" db schema: "+exceptionSqlStatement, e);
    }
  }
View Full Code Here

   * Will only create one instance, since at most one instance can be active.
   */
  protected void createInstances(ActivityExecution execution) throws Exception {
    int nrOfInstances = resolveNrOfInstances(execution);
    if (nrOfInstances <= 0) {
      throw new ActivitiException("Invalid number of instances: must be positive integer value"
              + ", but was " + nrOfInstances);
    }
   
    setLoopVariable(execution, NUMBER_OF_INSTANCES, nrOfInstances);
    setLoopVariable(execution, NUMBER_OF_COMPLETED_INSTANCES, 0);
View Full Code Here

        executeOriginalBehavior(execution, loopCounter);
      } catch (BpmnError error) {
        // re-throw business fault so that it can be caught by an Error Intermediate Event or Error Event Sub-Process in the process
        throw error;
      } catch (Exception e) {
        throw new ActivitiException("Could not execute inner activity behavior of multi instance behavior", e);
      }
    }
  }
View Full Code Here

        .createHistoricProcessInstanceQuery()
        .processInstanceId(processInstanceId)
        .singleResult();
   
    if(instance == null) {
      throw new ActivitiException("Process instance not found for id " + processInstanceId);
    }
   
    ObjectNode responseJSON = new ObjectMapper().createObjectNode();
    responseJSON.put("processInstanceId", instance.getId());
    if (instance.getBusinessKey() != null) {
View Full Code Here

  }


  public TaskEntity findTaskById(String id) {
    if (id == null) {
      throw new ActivitiException("Invalid task id : null");
    }
    return (TaskEntity) getDbSqlSession().selectOne("selectTask", id);
  }
View Full Code Here

TOP

Related Classes of org.activiti.engine.ActivitiException

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.