Package org.camunda.bpm.engine.impl.cfg

Examples of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl


  public void setRetriesFromPersistence(int retries) {
    this.retries = retries;
  }

  protected void createFailedJobIncident() {
    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    if (processEngineConfiguration
        .isCreateIncidentOnFailedJobEnabled()) {

      String incidentHandlerType = FailedJobIncidentHandler.INCIDENT_HANDLER_TYPE;

      // make sure job has an ID set:
      if(id == null) {
        id = processEngineConfiguration
            .getIdGenerator()
            .getNextId();

      } else {
        // check whether there exists already an incident
        // for this job
        List<Incident> failedJobIncidents = Context
            .getCommandContext()
            .getIncidentManager()
            .findIncidentByConfigurationAndIncidentType(id, incidentHandlerType);

        if (!failedJobIncidents.isEmpty()) {
          return;
        }

      }
      processEngineConfiguration
        .getIncidentHandler(incidentHandlerType)
        .handleIncident(getProcessDefinitionId(), null, executionId, id, exceptionMessage);

    }
  }
View Full Code Here


    return null;
  }

  public static void dbCreateHistoryLevel(DbEntityManager entityManager) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    HistoryLevel configuredHistoryLevel = processEngineConfiguration.getHistoryLevel();
    PropertyEntity property = new PropertyEntity("historyLevel", Integer.toString(configuredHistoryLevel.getId()));
    entityManager.insert(property);
    log.info("Creating historyLevel property in database with value: " + processEngineConfiguration.getHistory());
  }
View Full Code Here

   * @param bytes the byte array
   * @param processEngine the process engine
   * @return a string representing the bytes
   */
  public static String fromBytes(byte[] bytes) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if(processEngineConfiguration == null) {
      throw new IllegalStateException("Can only be called from active command context");
    }
    return fromBytes(bytes, processEngineConfiguration.getProcessEngine());
  }
View Full Code Here

   * @param bytes the byte array
   * @param processEngine the process engine
   * @return a string representing the bytes
   */
  public static String fromBytes(byte[] bytes, ProcessEngine processEngine) {
    ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
    Charset charset = processEngineConfiguration.getDefaultCharset();
    return new String(bytes, charset);
  }
View Full Code Here

   *
   * @param string the string to get the bytes form
   * @return the byte array
   */
  public static byte[] toByteArray(String string) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if(processEngineConfiguration == null) {
      throw new IllegalStateException("Can only be called from active command context");
    }
    return toByteArray(string, processEngineConfiguration.getProcessEngine());
  }
View Full Code Here

   * @param string the string to get the bytes form
   * @param processEngine the process engine to use
   * @return the byte array
   */
  public static byte[] toByteArray(String string, ProcessEngine processEngine) {
    ProcessEngineConfigurationImpl processEngineConfiguration = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration();
    Charset charset = processEngineConfiguration.getDefaultCharset();
    return string.getBytes(charset);
  }
View Full Code Here

  protected void setSubject(Email email, String subject) {
    email.setSubject(subject != null ? subject : "");
  }

  protected void setMailServerProperties(Email email) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    String host = processEngineConfiguration.getMailServerHost();
    ensureNotNull("Could not send email: no SMTP host is configured", "host", host);
    email.setHostName(host);

    int port = processEngineConfiguration.getMailServerPort();
    email.setSmtpPort(port);

    email.setTLS(processEngineConfiguration.getMailServerUseTLS());

    String user = processEngineConfiguration.getMailServerUsername();
    String password = processEngineConfiguration.getMailServerPassword();
    if (user != null && password != null) {
      email.setAuthentication(user, password);
    }
  }
View Full Code Here

  /**
   * Returns the configured script factory in the context or a new one.
   */
  public static ScriptFactory getScriptFactory() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if (processEngineConfiguration != null) {
      return processEngineConfiguration.getScriptFactory();
    }
    else {
      return new ScriptFactory();
    }
  }
View Full Code Here

    assertEquals("My Task", task.getName());

    taskService.complete(task.getId());
    assertEquals(0, runtimeService.createProcessInstanceQuery().count());

    ProcessEngineConfigurationImpl configuration = ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration();

    if (configuration.getHistoryLevel().getId() > ProcessEngineConfigurationImpl.HISTORYLEVEL_NONE) {
      assertEquals(1, historyService.createHistoricProcessInstanceQuery().count());
    }
  }
View Full Code Here

    }
    return true;
  }

  private static ClassLoader getCustomClassLoader() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if(processEngineConfiguration != null) {
      final ClassLoader classLoader = processEngineConfiguration.getClassLoader();
      if(classLoader != null) {
        return classLoader;
      }
    }
    return null;
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl

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.