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

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


    }
    return evaluateScript(engine, bindings);
  }

  protected void compileScript() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if (!processEngineConfiguration.isEnableScriptCompilation()) {
      // if script compilation is disabled abort
      shouldBeCompiled = false;
    }
    else {
      if (compiledScript == null && shouldBeCompiled) {
        synchronized (this) {
          if (compiledScript == null && shouldBeCompiled) {
            // try to compile script
            compiledScript = processEngineConfiguration.getScriptingEngines().compile(language, scriptSource);
            // either the script was successfully compiled or it can't be compiled but we won't try it again
            shouldBeCompiled = false;
          }
        }
      }
View Full Code Here


    TaskEntity task = (TaskEntity) taskForm.getTask();
    return executeScript(formTemplateString, task.getExecution());
  }

  protected Object executeScript(String scriptSrc, VariableScope scope) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    ScriptingEnvironment scriptingEnvironment = processEngineConfiguration.getScriptingEnvironment();
    ScriptFactory scriptFactory = processEngineConfiguration.getScriptFactory();
    ExecutableScript script = scriptFactory.createScriptFromSource(ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE, scriptSrc);
    return scriptingEnvironment.execute(script, scope);
  }
View Full Code Here

  public void fireHistoricVariableInstanceDelete(VariableInstanceEntity variableInstance, AbstractVariableScope sourceActivityExecution) {

    HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel();
    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.VARIABLE_INSTANCE_DELETE, variableInstance)) {

      final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
      final HistoryEventHandler eventHandler = processEngineConfiguration.getHistoryEventHandler();
      final HistoryEventProducer eventProducer = processEngineConfiguration.getHistoryEventProducer();

      HistoryEvent evt = eventProducer.createHistoricVariableDeleteEvt(variableInstance, sourceActivityExecution);
      eventHandler.handleEvent(evt);

    }
View Full Code Here

  public void fireHistoricVariableInstanceCreate(VariableInstanceEntity variableInstance, AbstractVariableScope sourceActivityExecution) {

    HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel();
    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.VARIABLE_INSTANCE_CREATE, variableInstance)) {

      final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
      final HistoryEventHandler eventHandler = processEngineConfiguration.getHistoryEventHandler();
      final HistoryEventProducer eventProducer = processEngineConfiguration.getHistoryEventProducer();

      HistoryEvent evt = eventProducer.createHistoricVariableCreateEvt(variableInstance, sourceActivityExecution);
      eventHandler.handleEvent(evt);

    }
View Full Code Here

  public void fireHistoricVariableInstanceUpdate(VariableInstanceEntity variableInstance, AbstractVariableScope sourceActivityExecution) {
    HistoryLevel historyLevel = Context.getProcessEngineConfiguration().getHistoryLevel();
    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.VARIABLE_INSTANCE_UPDATE, variableInstance)) {

      final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
      final HistoryEventHandler eventHandler = processEngineConfiguration.getHistoryEventHandler();
      final HistoryEventProducer eventProducer = processEngineConfiguration.getHistoryEventProducer();

      HistoryEvent evt = eventProducer.createHistoricVariableUpdateEvt(variableInstance, sourceActivityExecution);
      eventHandler.handleEvent(evt);

    }
View Full Code Here

  }

  public ProcessApplicationRegistration execute(CommandContext commandContext) {

    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    final ProcessApplicationManager processApplicationManager = processEngineConfiguration.getProcessApplicationManager();

    return processApplicationManager.registerProcessApplicationForDeployments(deploymentsToRegister, reference);
  }
View Full Code Here

  }

  protected void initializeEntityCache() {

    final JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    if(processEngineConfiguration != null
        && processEngineConfiguration.isDbEntityCacheReuseEnabled()
        && jobExecutorContext != null) {

      dbEntityCache = jobExecutorContext.getEntityCache();
      if(dbEntityCache == null) {
        dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping());
        jobExecutorContext.setEntityCache(dbEntityCache);
      }

    } else {

      if (processEngineConfiguration != null) {
        dbEntityCache = new DbEntityCache(processEngineConfiguration.getDbEntityCacheKeyMapping());
      } else {
        dbEntityCache = new DbEntityCache();
      }
    }
View Full Code Here

    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

    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

  }

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

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.