01-28-2019 03:05 PM
Hi Everyone,
I am using Activiti with spring boot, I am facing few performance issues while getting the data from the activiti tables this is due to the history tables I guess.
When I am querying for the data from the activiti tables, in the 1st scenario it took 0.239 seconds to get the result but in the 2nd scenario it took 1.884 seconds to fetch the data from the database.
Table Name | Total records available (1st scenario) | Total records available (2nd scenario) | |
---|---|---|---|
| 2177 | 7162 | |
| 2452 | 16702 | |
| 1254 | 8409 | |
| 407 | 3569 | |
| 1254 | 8409 | |
| 407 | 3569 |
This is the main reason, I want to disable the history.
Tech stack:
Spring Activiti - 5.22.0
Spring Boot version - 1.5.8.Release
MyBatis for ORM
Please let me know, Is there any configuration to disable the history and will be there any problems if we disable the history.
Regards
Yashu
@ Edited
I tried the below code, which I kept it in springboot configuration class. Still no luck.
@Bean
public ProcessEngineConfigurationImpl getProcessEngineConfiguration() {
SpringProcessEngineConfiguration processEngineConf = new SpringProcessEngineConfiguration();
processEngineConf.setHistory(HistoryLevel.NONE.getKey());
return processEngineConf;
}
01-31-2019 11:37 PM
I got solution for the problem which I am facing. Below is the code which is the solution which worked for me.
@Autowired
private SpringProcessEngineConfiguration config;
@GetMapping("/startProcess")
public String startProcess() {
config.setHistoryLevel(HistoryLevel.NONE);
System.out.println(config.getHistoryLevel());
RuntimeService runtimeService = config.getRuntimeService();
runtimeService.startProcessInstanceByKey("testing_DeletingHistory", "start");
Thanks everyone.
01-31-2019 12:16 PM
Not sure about the Spring equivalent but In version 5.22, and using the Java API, I create an engine using a configuration created via ProcessEngineConfiguration.createProcessEngineConfigurationFromResource() which takes an XML config file with the line <property name="history" value="none"/>. This does turn the history off, and everything works fine, unless you are relying on the history tables of course. History can impact performance as you suspect.
01-31-2019 11:35 PM
Thanks PaulT _ .
01-31-2019 11:37 PM
I got solution for the problem which I am facing. Below is the code which is the solution which worked for me.
@Autowired
private SpringProcessEngineConfiguration config;
@GetMapping("/startProcess")
public String startProcess() {
config.setHistoryLevel(HistoryLevel.NONE);
System.out.println(config.getHistoryLevel());
RuntimeService runtimeService = config.getRuntimeService();
runtimeService.startProcessInstanceByKey("testing_DeletingHistory", "start");
Thanks everyone.
Explore our Alfresco products with the links below. Use labels to filter content by product module.