Examples of ProcessEngineConfigurationImpl


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

    fireFormPropertyHistoryEvents(properties, variableScope);
  }

  protected void fireFormPropertyHistoryEvents(VariableMap properties, VariableScope variableScope) {
    final ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel();

    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.FORM_PROPERTY_UPDATE, variableScope)) {

      // fire history events
      ExecutionEntity executionEntity = null;
      String taskId = null;
      if(variableScope instanceof ExecutionEntity) {
        executionEntity = (ExecutionEntity) variableScope;
      }
      else if (variableScope instanceof TaskEntity) {
        TaskEntity task = (TaskEntity) variableScope;
        executionEntity = task.getExecution();
        taskId = task.getId();
      }

      if (executionEntity != null) {
        final HistoryEventProducer eventProducer = processEngineConfiguration.getHistoryEventProducer();
        final HistoryEventHandler eventHandler = processEngineConfiguration.getHistoryEventHandler();

        for (String variableName : properties.keySet()) {

          TypedValue value = properties.getValueTyped(variableName);
View Full Code Here

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

      configurationClassName = StandaloneProcessEngineConfiguration.class.getName();
    }

    // create & instantiate configuration class
    Class<? extends ProcessEngineConfigurationImpl> configurationClass = loadClass(configurationClassName, classLoader, ProcessEngineConfigurationImpl.class);
    ProcessEngineConfigurationImpl configuration = createInstance(configurationClass);

    // set UUid generator
    // TODO: move this to configuration and use as default?
    ProcessEngineConfigurationImpl configurationImpl = configuration;
    configurationImpl.setIdGenerator(new StrongUuidGenerator());

    configureCustomRetryStrategy(configurationImpl);

    // set configuration values
    String name = processEngineXml.getName();
    configuration.setProcessEngineName(name);

    String datasourceJndiName = processEngineXml.getDatasource();
    configuration.setDataSourceJndiName(datasourceJndiName);

    // apply properties
    Map<String, String> properties = processEngineXml.getProperties();
    PropertyHelper.applyProperties(configuration, properties);

    // instantiate plugins:
    configurePlugins(configuration, processEngineXml, classLoader);

    if(processEngineXml.getJobAcquisitionName() != null && !processEngineXml.getJobAcquisitionName().isEmpty()) {
      JobExecutor jobExecutor = getJobExecutorService(serviceContainer);
      ensureNotNull("Cannot find referenced job executor with name '" + processEngineXml.getJobAcquisitionName() + "'", "jobExecutor", jobExecutor);

      // set JobExecutor on process engine
      configurationImpl.setJobExecutor(jobExecutor);
    }

    // start the process engine inside the container.
    JmxManagedProcessEngine managedProcessEngineService = createProcessEngineControllerInstance(configuration);
    serviceContainer.startService(ServiceTypes.PROCESS_ENGINE, configuration.getProcessEngineName(), managedProcessEngineService);
View Full Code Here

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

    this.wrappedBindings = wrappedBindings;
    autoStoreScriptVariables = isAutoStoreScriptVariablesEnabled();
  }

  protected boolean isAutoStoreScriptVariablesEnabled() {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();
    if(processEngineConfiguration != null) {
      return processEngineConfiguration.isAutoStoreScriptVariables();
    }
    return false;
  }
View Full Code Here

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

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

    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

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

  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

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

  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

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

  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

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

  }

  public ProcessApplicationRegistration execute(CommandContext commandContext) {

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

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

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

  }

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