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

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


  }

  public void checkAuthorization(Permission permission, Resource resource, String resourceId) {

    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    final Authentication currentAuthentication = Context.getCommandContext().getAuthentication();

    if(processEngineConfiguration.isAuthorizationEnabled() && currentAuthentication != null) {

      boolean isAuthorized = isAuthorized(currentAuthentication.getUserId(), currentAuthentication.getGroupIds(), permission, resource, resourceId);
      if (!isAuthorized) {
        throw new AuthorizationException(currentAuthentication.getUserId(), permission.getName(), resource.resourceName(), resourceId);
      }
View Full Code Here


    return getDbEntityManager().selectBoolean("isUserAuthorizedForResource", authCheck);
  }

  public boolean isAuthorized(Permission permission, Resource resource, String resourceId) {

    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    final Authentication currentAuthentication = Context.getCommandContext().getAuthentication();

    if(processEngineConfiguration.isAuthorizationEnabled() && currentAuthentication != null) {
      return isAuthorized(currentAuthentication.getUserId(), currentAuthentication.getGroupIds(), permission, resource, resourceId);

    } else {
      return true;
View Full Code Here

    if(resourceId == null) {
      throw new IllegalArgumentException("Resource id cannot be null");
    }

    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if(processEngineConfiguration.isAuthorizationEnabled()) {
      Map<String, Object> deleteParams = new HashMap<String, Object>();
      deleteParams.put("resourceType", resource.resourceType());
      deleteParams.put("resourceId", resourceId);
      getDbEntityManager().delete(AuthorizationEntity.class, "deleteAuthorizationsForResourceId", deleteParams);
    }
View Full Code Here

    LogVariableListener.reset();
  }

  protected void initializeProcessEngine() {
    if (processEngine == null) {
      ProcessEngineConfigurationImpl engineConfig =
          (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("camunda.cfg.xml");

      engineConfig.setBeans(beans);

      processEngine = engineConfig.buildProcessEngine();
    }
  }
View Full Code Here

  /**
   * Assures that property names are matched on the setter name according to java beans conventions
   * and not on the field name.
   */
  public void testConfigurationPropertiesWithMismatchingFieldAndSetter() {
    ProcessEngineConfigurationImpl engineConfiguration = new StandaloneProcessEngineConfiguration();
   
    Map<String, String> propertiesToSet = new HashMap<String, String>();
    propertiesToSet.put(DB_IDENTITY_USED_PROP, "false");
    PropertyHelper.applyProperties(engineConfiguration, propertiesToSet);
   
    Assert.assertFalse(engineConfiguration.isDbIdentityUsed());
   
    propertiesToSet.put(DB_IDENTITY_USED_PROP, "true");
    PropertyHelper.applyProperties(engineConfiguration, propertiesToSet);
   
    Assert.assertTrue(engineConfiguration.isDbIdentityUsed());
  }
View Full Code Here

  protected abstract void updateBulk(DbBulkOperation operation);

  protected abstract String getDbVersion();

  public void dbSchemaCreate() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    HistoryLevel configuredHistoryLevel = processEngineConfiguration.getHistoryLevel();
    if ( (!processEngineConfiguration.isDbHistoryUsed())
         && (!configuredHistoryLevel.equals(HistoryLevel.HISTORY_LEVEL_NONE))
       ) {
      throw new ProcessEngineException("historyLevel config is higher then 'none' and dbHistoryUsed is set to false");
    }

    if (isEngineTablePresent()) {
      String dbVersion = getDbVersion();
      if (!ProcessEngine.VERSION.equals(dbVersion)) {
        throw new WrongDbException(ProcessEngine.VERSION, dbVersion);
      }
    } else {
      dbSchemaCreateEngine();
    }

    if (processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaCreateHistory();
    }

    if (processEngineConfiguration.isDbIdentityUsed()) {
      dbSchemaCreateIdentity();
    }

    if (processEngineConfiguration.isCmmnEnabled()) {
      dbSchemaCreateCmmn();
    }

    if (processEngineConfiguration.isCmmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaCreateCmmnHistory();
    }
  }
View Full Code Here

  protected abstract void dbSchemaCreateCmmn();

  protected abstract void dbSchemaCreateCmmnHistory();

  public void dbSchemaDrop() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    if (processEngineConfiguration.isCmmnEnabled()) {
      dbSchemaDropCmmn();
    }

    dbSchemaDropEngine();

    if (processEngineConfiguration.isCmmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaDropCmmnHistory();
    }

    if (processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaDropHistory();
    }

    if (processEngineConfiguration.isDbIdentityUsed()) {
      dbSchemaDropIdentity();
    }
  }
View Full Code Here

  protected abstract void dbSchemaDropCmmn();

  protected abstract void dbSchemaDropCmmnHistory();

  public void dbSchemaPrune() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if (isHistoryTablePresent() && !processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaDropHistory();
    }
    if (isIdentityTablePresent() && !processEngineConfiguration.isDbIdentityUsed()) {
      dbSchemaDropIdentity();
    }
    if (isCmmnTablePresent() && !processEngineConfiguration.isCmmnEnabled()) {
      dbSchemaDropCmmn();
    }
    if (isCmmnHistoryTablePresent() && !processEngineConfiguration.isCmmnEnabled()) {
      dbSchemaCreateCmmnHistory();
    }
  }
View Full Code Here

  public abstract boolean isCmmnTablePresent();

  public abstract boolean isCmmnHistoryTablePresent();

  public void dbSchemaUpdate() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    if (!isEngineTablePresent()) {
      dbSchemaCreateEngine();
    }

    if (!isHistoryTablePresent() && processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaCreateHistory();
    }

    if (!isIdentityTablePresent() && processEngineConfiguration.isDbIdentityUsed()) {
      dbSchemaCreateIdentity();
    }

    if (!isCmmnTablePresent() && processEngineConfiguration.isCmmnEnabled()) {
      dbSchemaCreateCmmn();
    }

    if (!isCmmnHistoryTablePresent() && processEngineConfiguration.isCmmnEnabled() && processEngineConfiguration.isDbHistoryUsed()) {
      dbSchemaCreateCmmnHistory();
    }

  }
View Full Code Here

    this.properties = properties;
  }

  @Override
  public ProcessInstance execute(CommandContext commandContext) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    ProcessDefinitionEntity processDefinition = processEngineConfiguration
      .getDeploymentCache()
      .findDeployedProcessDefinitionById(processDefinitionId);

    ensureNotNull("No process definition found for id = '" + processDefinitionId + "'", "processDefinition", processDefinition);
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.