03-09-2016 05:55 AM
<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>
03-10-2016 02:43 AM
03-10-2016 08:01 AM
03-11-2016 03:28 AM
03-11-2016 05:24 AM
03-14-2016 04:48 AM
@Test
@Deployment(resources = {"org/activiti/test/my-process.bpmn20.xml", "org/activiti/test/my-process-service-task.bpmn20.xml"})
public void test() {
ProcessEngines.init();
final ProcessEngine processEngine = ProcessEngineConfiguration
.createProcessEngineConfigurationFromResourceDefault()
.setHistory(HistoryLevel.FULL.getKey())
.buildProcessEngine();
long historicProcessInstancesCountBeforeServiceTask = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().count();
new Thread(new Runnable() {
public void run() {
processEngine.getRuntimeService().startProcessInstanceByKey("my-process-service-task");
}
}).start();
try {
Thread.sleep(20000);
} catch (InterruptedException ex) {
Logger.getLogger(MyUnitTest.class.getName()).log(Level.SEVERE, null, ex);
}
long historicProcessInstancesCountAfterServiceTask = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().count();
assertEquals(historicProcessInstancesCountBeforeServiceTask + 1, historicProcessInstancesCountAfterServiceTask);
}
public class TestServiceTaskWait implements JavaDelegate {
@Override
public void execute(DelegateExecution execution) throws Exception {
Thread.sleep(10000000);
}
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.