Examples of ProcessEngineConfigurationImpl


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

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

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

    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

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

    }
    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

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

    HistoryEventType eventType = resolved ? HistoryEventTypes.INCIDENT_RESOLVE : HistoryEventTypes.INCIDENT_DELETE;
    fireHistoricIncidentEvent(eventType);
  }

  protected void fireHistoricIncidentEvent(HistoryEventType eventType) {
    ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration();

    HistoryLevel historyLevel = processEngineConfiguration.getHistoryLevel();
    if(historyLevel.isHistoryEventProduced(eventType, this)) {

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

      HistoryEvent event = null;
      if (HistoryEvent.INCIDENT_CREATE.equals(eventType.getEventName())) {
        event = eventProducer.createHistoricIncidentCreateEvt(this);
View Full Code Here

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

    return subCaseInstance;
  }

  public void fireHistoricCaseActivityInstanceUpdate() {
    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
    HistoryLevel historyLevel = configuration.getHistoryLevel();
    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.CASE_ACTIVITY_INSTANCE_UPDATE, this)) {
      CmmnHistoryEventProducer eventProducer = configuration.getCmmnHistoryEventProducer();
      HistoryEventHandler eventHandler = configuration.getHistoryEventHandler();

      HistoryEvent event = eventProducer.createCaseActivityInstanceUpdateEvt(this);
      eventHandler.handleEvent(event);
    }
  }
View Full Code Here

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

    if (initiatorVariableName != null) {
      String authenticatedUserId = Context.getCommandContext().getAuthenticatedUserId();
      processInstance.setVariable(initiatorVariableName, authenticatedUserId);
    }

    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();
    HistoryLevel historyLevel = configuration.getHistoryLevel();
    // TODO: This smells bad, as the rest of the history is done via the ParseListener
    if (historyLevel.isHistoryEventProduced(HistoryEventTypes.PROCESS_INSTANCE_START, processInstance)) {

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

      // publish event for historic process instance start
      HistoryEvent pise = eventFactory.createProcessInstanceStartEvt(processInstance);
      eventHandler.handleEvent(pise);
View Full Code Here

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

    final String schemaFileResourceName = args[1];

    ensureNotNull("Process engine configuration file name cannot be null", "configurationFileResourceName", configurationFileResourceName);
    ensureNotNull("Schema resource file name cannot be null", "schemaFileResourceName", schemaFileResourceName);

    ProcessEngineConfigurationImpl configuration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResource(configurationFileResourceName);
    ProcessEngine processEngine = configuration.buildProcessEngine();

    configuration.getCommandExecutorTxRequired().execute(new Command<Void>() {

      public Void execute(CommandContext commandContext) {

        commandContext.getDbSqlSession()
          .executeSchemaResource(schemaFileResourceName);
View Full Code Here

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

  public long findHistoricTaskInstanceCountByNativeQuery(final Map<String, Object> parameterMap) {
    return (Long) getDbEntityManager().selectOne("selectHistoricTaskInstanceCountByNativeQuery", parameterMap);
  }

  public void updateHistoricTaskInstance(TaskEntity taskEntity) {
    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();

    HistoryLevel historyLevel = configuration.getHistoryLevel();
    if(historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_UPDATE, taskEntity)) {

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

      HistoryEvent evt = eventProducer.createTaskInstanceUpdateEvt(taskEntity);
      eventHandler.handleEvent(evt);

    }
View Full Code Here

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

    }
  }

  public void markTaskInstanceEnded(String taskId, String deleteReason) {
    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();

    TaskEntity taskEntity = Context.getCommandContext()
        .getDbEntityManager()
        .selectById(TaskEntity.class, taskId);

    HistoryLevel historyLevel = configuration.getHistoryLevel();
    if(historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_COMPLETE, taskEntity)) {

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

      HistoryEvent evt = eventProducer.createTaskInstanceCompleteEvt(taskEntity, deleteReason);

      eventHandler.handleEvent(evt);
    }
View Full Code Here

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

    }
  }


  public void createHistoricTask(TaskEntity task) {
    ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration();

    HistoryLevel historyLevel = configuration.getHistoryLevel();
    if(historyLevel.isHistoryEventProduced(HistoryEventTypes.TASK_INSTANCE_CREATE, task)) {

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

      HistoryEvent evt = eventProducer.createTaskInstanceCreateEvt(task);
      eventHandler.handleEvent(evt);

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