cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to disable services?

abhip
Champ in-the-making
Champ in-the-making
Hi,

I want to use only taskService, history service in my application.
Is it possible to disable the remaining services ?
so that tables associated with those services will not get created. and I will not have redundant tables in db.

13 REPLIES 13

jbarrez
Star Contributor
Star Contributor
Activiti only allows to not create historic and identity tables.

You would need to create an extension of the ProcessEngine yourself to disable them. However, I don't see what the use case would be to do that?

abhip
Champ in-the-making
Champ in-the-making
Thanks for the quick reply!

How can we disable? is there any API to do that?

trademak
Star Contributor
Star Contributor
There are properties in the ProcessEngineConfiguration class that allow you to do this:

dbIdentityUsed
dbHistoryUsed

If you specify false for these properties in your process engine configuration no history and identity tables will be created. In addition you would have to set the historyLevel to none.

Best regards,

tgebeyehu
Champ in-the-making
Champ in-the-making
Hi every one,

since this is related with the above question i prefer to post it here than opening a new one.
i am using  activiti-spring-boot-starter and want to disable dbIdentityUsed .
How can i set it false? what is the right way of doing this? i tried the following in application.properties but it does not disabled it.
<java>spring.activiti.dbIdentityUsed  = false
   and
spring.dbIdentityUsed = false
</java>
Thank you

jbarrez
Star Contributor
Star Contributor
No, those properties are not exposed.
You will have to use an instance of this https://github.com/Activiti/Activiti/blob/master/modules/activiti-spring-boot/spring-boot-starters/a... to set the property programmatically.

tgebeyehu
Champ in-the-making
Champ in-the-making
Hey Joram,

Thank you for the quick response. My goal is to include the #taskCandidateGroupIn(List) in my taskQuery.  as mentioned in the description below, to do so i have to set dbIdentityUsed to false.
<java>
  /** Select tasks that has been claimed or assigned to user or waiting to claim by user (candidate user or groups).
   *  You can invoke {@link #taskCandidateGroupIn(List)} to include tasks that can be claimed by a user in the given groups
   *  while set property <strong>dbIdentityUsed</strong> to <strong>false</strong> in process engine configuration
   *  or using custom session factory of GroupIdentityManager.
   */
  TaskQuery taskCandidateOrAssigned(String userIdForCandidateAndAssignee);
</java>

i try to implement the ProcessEngineConfigurationConfigurer and on the override method i set the dbIdentityUsed to false like this,
<java>
    @Override
    public void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration)
    {
        springProcessEngineConfiguration.getProcessEngineConfiguration().setDbIdentityUsed(false);
    }
  </java>
but this time i have an issue with the db not finding the table and the user is not able to log in.  This happen when the db is empty ( i am saving the users when they first log in - that is a requirement). if the db is already initialized i don't see the issue.

so my question will be, what is the best way of disabling it to make sure that taskCandidateGroupIn(List) is executed with taskCandidateOrAssigned(String)  correctly.

Thank you in advance



jbarrez
Star Contributor
Star Contributor
Not sure I'm following: if the process engine bean is configured correctly, the database schema will exist, right?
So what do you mean with 'when the db is empty'?

tgebeyehu
Champ in-the-making
Champ in-the-making
Sorry if i did not explain it clearly

I set <java>DbIdentityUsed</java> to <java>False</java>, I clear the db and restart the system, Then when i try to access the system i get an error saying that it can not find the user table. when i check the DB i saw that all the Identity tables are not created.  ACT_ID_GROUP, INFO, MEMBER AND USER tables are not created.

error log
<java> org.apache.ibatis.exceptions.PersistenceException:
### Error querying database.  Cause: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SELECT RES.*
    
    FROM ACT_ID_USER RES
    
     WHERE RES.ID_ = ?
  
     ORDER BY  ORDER
  • BY RES.ID_ ASC
  •     LIMIT ? OFFSET ? "; expected "=, NOT, EXISTS, INTERSECTS, SELECT, FROM"; SQL statement:
    select RES.*
        
        from ACT_ID_USER RES
        
         WHERE RES.ID_ = ?
      
         order by  order by RES.ID_ asc 
        LIMIT ? OFFSET ? [42001-190]
    ### The error may exist in org/activiti/db/mapping/entity/User.xml
    ### The error may involve org.activiti.engine.impl.persistence.entity.UserEntity.selectUserByQueryCriteria
    ### The error occurred while executing a query
    ### SQL: select RES.*            from ACT_ID_USER RES             WHERE RES.ID_ = ?           order by  order by RES.ID_ asc       LIMIT ? OFFSET ?
    ### Cause: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SELECT RES.*
        
        FROM ACT_ID_USER RES
        
         WHERE RES.ID_ = ?
      
         ORDER BY  ORDER
  • BY RES.ID_ ASC
  •     LIMIT ? OFFSET ? "; expected "=, NOT, EXISTS, INTERSECTS, SELECT, FROM"; SQL statement:
    select RES.*
        
        from ACT_ID_USER RES
        
         WHERE RES.ID_ = ?
      
         order by  order by RES.ID_ asc 
        LIMIT ? OFFSET ? [42001-190]
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) ~[mybatis-3.3.0.jar:3.3.0]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:122) ~[mybatis-3.3.0.jar:3.3.0]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113) ~[mybatis-3.3.0.jar:3.3.0] </java>

    Thank you

    tgebeyehu
    Champ in-the-making
    Champ in-the-making
    i setDbIdentityUsed to true first and start the system after the db is initialized i shut it down and set the value to false.
    it then works fine. on activiti-version 5.19.0.1

    thanks