Examples of ProcessEngineConfigurationImpl


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

    this.variables = Variables.fromMap(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

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

    if(caseInstanceId != null) {
      subProcessInstance.setCaseInstanceId(caseInstanceId);
    }

    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
    HistoryLevel historyLevel = configuration.getHistoryLevel();
    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.ACTIVITY_INSTANCE_UPDATE, this)) {

      final HistoryEventProducer eventFactory = configuration.getHistoryEventProducer();
      final HistoryEventHandler eventHandler = configuration.getHistoryEventHandler();

      // publish start event for sub process instance
      HistoryEvent hpise = eventFactory.createProcessInstanceStartEvt(subProcessInstance);
      eventHandler.handleEvent(hpise);
View Full Code Here

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

  }

  // authorization checks ///////////////////////////////////////////

  public void configureQuery(AbstractQuery query, Resource resource) {
    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    final Authentication currentAuthentication = Context.getCommandContext().getAuthentication();

    if(processEngineConfiguration.isAuthorizationEnabled() && currentAuthentication != null) {
      query.setAuthorizationCheckEnabled(true);
      query.setAuthUserId(currentAuthentication.getUserId());
      query.setAuthGroupIds(currentAuthentication.getGroupIds());
      query.setAuthResourceType(resource.resourceType());
      query.setAuthResourceIdQueryParam("RES.ID_");
View Full Code Here

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

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

    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

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

    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

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

    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

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

  /**
   * 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

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

  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

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

  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
TOP
Copyright © 2018 www.massapi.com. 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.