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;
}
Solved! Go to Solution.
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.
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.
Thanks PaulT _ .
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.
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.