As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context"> <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration"> <property name="jdbcUrl" value="jdbc:postgresql://…" /> <property name="jdbcDriver" value="org.postgresql.Driver" /> <property name="jdbcUsername" value="…" /> <property name="jdbcPassword" value="…" /> <property name="jobExecutorActivate" value="false" /> <property name="asyncExecutorEnabled" value="true" /> <property name="asyncExecutorActivate" value="true" /> </bean> </beans>
<br> @Test<br> @Deployment(resources = {"org/activiti/test/my-process.bpmn20.xml", "org/activiti/test/my-process-service-task.bpmn20.xml"})<br> public void test() {<br> ProcessEngines.init();<br> final ProcessEngine processEngine = ProcessEngineConfiguration<br> .createProcessEngineConfigurationFromResourceDefault()<br> .setHistory(HistoryLevel.FULL.getKey())<br> .buildProcessEngine();<br><br> long historicProcessInstancesCountBeforeServiceTask = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().count();<br> new Thread(new Runnable() {<br> public void run() {<br> processEngine.getRuntimeService().startProcessInstanceByKey("my-process-service-task");<br><br> }<br> }).start();<br> try {<br> Thread.sleep(20000);<br> } catch (InterruptedException ex) {<br> Logger.getLogger(MyUnitTest.class.getName()).log(Level.SEVERE, null, ex);<br> }<br><br> long historicProcessInstancesCountAfterServiceTask = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().count();<br> assertEquals(historicProcessInstancesCountBeforeServiceTask + 1, historicProcessInstancesCountAfterServiceTask);<br> }<br>
<br>public class TestServiceTaskWait implements JavaDelegate {<br><br> @Override<br> public void execute(DelegateExecution execution) throws Exception {<br> Thread.sleep(10000000);<br> }<br><br>}<br>