Java Code Examples for org.activiti.engine.impl.variable.EntityManagerSessionFactory#getEntityManagerFactory()
The following examples show how to use
org.activiti.engine.impl.variable.EntityManagerSessionFactory#getEntityManagerFactory() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JPAEnhancedVariableTest.java From activiti6-boot2 with Apache License 2.0 | 6 votes |
@Override protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("org/activiti/standalone/jpa/activiti.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration.getSessionFactories().get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); setupJPAVariables(); } processEngine = cachedProcessEngine; }
Example 2
Source File: HistoricJPAVariableTest.java From activiti6-boot2 with Apache License 2.0 | 6 votes |
@Override protected void initializeProcessEngine() { if (cachedProcessEngine==null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("org/activiti/standalone/jpa/activiti.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration .getSessionFactories() .get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }
Example 3
Source File: JPAVariableTest.java From flowable-engine with Apache License 2.0 | 6 votes |
protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("org/activiti/standalone/jpa/flowable.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl activiti5ProcessEngineConfig = (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) ((ProcessEngineConfigurationImpl) cachedProcessEngine .getProcessEngineConfiguration()).getFlowable5CompatibilityHandler().getRawProcessConfiguration(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) activiti5ProcessEngineConfig .getSessionFactories() .get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }
Example 4
Source File: JPAEnhancedVariableTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("org/activiti/standalone/jpa/flowable.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); activiti5ProcessEngineConfig = (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) ((ProcessEngineConfigurationImpl) cachedProcessEngine.getProcessEngineConfiguration()).getFlowable5CompatibilityHandler() .getRawProcessConfiguration(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) activiti5ProcessEngineConfig .getSessionFactories() .get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); setupJPAVariables(); } processEngine = cachedProcessEngine; }
Example 5
Source File: HistoricJPAVariableTest.java From flowable-engine with Apache License 2.0 | 6 votes |
@Override protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("org/activiti/standalone/jpa/flowable.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl activiti5ProcessEngineConfig = (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) ((ProcessEngineConfigurationImpl) cachedProcessEngine .getProcessEngineConfiguration()).getFlowable5CompatibilityHandler().getRawProcessConfiguration(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) activiti5ProcessEngineConfig .getSessionFactories() .get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }
Example 6
Source File: LeaveJpaEntityTest.java From activiti-in-action-codes with Apache License 2.0 | 6 votes |
protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("activiti.jpa.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration .getSessionFactories() .get(EntityManagerSession.class); System.out.println("entityManagerSessionFactory=" + entityManagerSessionFactory); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }
Example 7
Source File: JPAVariableTest.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("org/activiti/standalone/jpa/activiti.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration.getSessionFactories().get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }
Example 8
Source File: FullHistoryTest.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@Deployment(resources = { "org/activiti/standalone/jpa/JPAVariableTest.testQueryJPAVariable.bpmn20.xml" }) public void testReadJpaVariableValueFromHistoricVariableUpdate() { EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration.getSessionFactories().get(EntityManagerSession.class); EntityManagerFactory entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); String executionId = runtimeService.startProcessInstanceByKey("JPAVariableProcess").getProcessInstanceId(); String variableName = "name"; FieldAccessJPAEntity entity = new FieldAccessJPAEntity(); entity.setId(1L); entity.setValue("Test"); EntityManager manager = entityManagerFactory.createEntityManager(); manager.getTransaction().begin(); manager.persist(entity); manager.flush(); manager.getTransaction().commit(); manager.close(); Task task = taskService.createTaskQuery().processInstanceId(executionId).taskName("my task").singleResult(); runtimeService.setVariable(executionId, variableName, entity); taskService.complete(task.getId()); List<HistoricDetail> variableUpdates = historyService.createHistoricDetailQuery().processInstanceId(executionId).variableUpdates().list(); assertEquals(1, variableUpdates.size()); HistoricVariableUpdate update = (HistoricVariableUpdate) variableUpdates.get(0); assertNotNull(update.getValue()); assertTrue(update.getValue() instanceof FieldAccessJPAEntity); assertEquals(entity.getId(), ((FieldAccessJPAEntity) update.getValue()).getId()); }
Example 9
Source File: FullHistoryTest.java From flowable-engine with Apache License 2.0 | 5 votes |
@Deployment(resources = { "org/activiti/standalone/jpa/JPAVariableTest.testQueryJPAVariable.bpmn20.xml" }) public void testReadJpaVariableValueFromHistoricVariableUpdate() { org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl activiti5ProcessEngineConfig = (org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl) processEngineConfiguration.getFlowable5CompatibilityHandler() .getRawProcessConfiguration(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) activiti5ProcessEngineConfig .getSessionFactories() .get(EntityManagerSession.class); EntityManagerFactory entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); String executionId = runtimeService.startProcessInstanceByKey("JPAVariableProcess").getProcessInstanceId(); String variableName = "name"; FieldAccessJPAEntity entity = new FieldAccessJPAEntity(); entity.setId(1L); entity.setValue("Test"); EntityManager manager = entityManagerFactory.createEntityManager(); manager.getTransaction().begin(); manager.persist(entity); manager.flush(); manager.getTransaction().commit(); manager.close(); org.flowable.task.api.Task task = taskService.createTaskQuery().processInstanceId(executionId).taskName("my task").singleResult(); runtimeService.setVariable(executionId, variableName, entity); taskService.complete(task.getId()); List<org.activiti.engine.history.HistoricDetail> variableUpdates = activiti5ProcessEngineConfig.getHistoryService().createHistoricDetailQuery().processInstanceId(executionId).variableUpdates().list(); assertEquals(1, variableUpdates.size()); org.activiti.engine.history.HistoricVariableUpdate update = (org.activiti.engine.history.HistoricVariableUpdate) variableUpdates.get(0); assertNotNull(update.getValue()); assertTrue(update.getValue() instanceof FieldAccessJPAEntity); assertEquals(entity.getId(), ((FieldAccessJPAEntity) update.getValue()).getId()); }
Example 10
Source File: LeaveJpaEntityTest.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("activiti.jpa.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration .getSessionFactories() .get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }
Example 11
Source File: LeaveJpaEntityTest.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("activiti.jpa.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration .getSessionFactories() .get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }
Example 12
Source File: LeaveJpaEntityTest.java From activiti-in-action-codes with Apache License 2.0 | 5 votes |
protected void initializeProcessEngine() { if (cachedProcessEngine == null) { ProcessEngineConfigurationImpl processEngineConfiguration = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration .createProcessEngineConfigurationFromResource("activiti.jpa.cfg.xml"); cachedProcessEngine = processEngineConfiguration.buildProcessEngine(); EntityManagerSessionFactory entityManagerSessionFactory = (EntityManagerSessionFactory) processEngineConfiguration .getSessionFactories() .get(EntityManagerSession.class); entityManagerFactory = entityManagerSessionFactory.getEntityManagerFactory(); } processEngine = cachedProcessEngine; }