cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an Activiti API method to get the schema version ?

badrisudheer
Champ in-the-making
Champ in-the-making

Instead of going to DB table ACT_GE_PROPERTY and retrieve value for schema.version, just thinking if there is a service api from process engine factory which is readily available that might have a property (preloaded) or a getter for schema version.

1 ACCEPTED ANSWER

daisuke-yoshimo
Star Collaborator
Star Collaborator

If you want to get the version of Activiti source, you can get like the following code.

ProcessEngine.VERSION

If you want to get the version of schema.version, you can get like the following code.

String dbVersion = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getCommandExecutor().execute(new Command<String>() {

    public String execute(CommandContext commandContext) {

    PropertyEntity dbVersionProperty = commandContext.getSession(DbSqlSession.class).selectById(PropertyEntity.class,"schema.version");

    String dbVersion = dbVersionProperty.getValue();

    return dbVersion;

    }

});

View answer in original post

1 REPLY 1

daisuke-yoshimo
Star Collaborator
Star Collaborator

If you want to get the version of Activiti source, you can get like the following code.

ProcessEngine.VERSION

If you want to get the version of schema.version, you can get like the following code.

String dbVersion = ((ProcessEngineConfigurationImpl) processEngineConfiguration).getCommandExecutor().execute(new Command<String>() {

    public String execute(CommandContext commandContext) {

    PropertyEntity dbVersionProperty = commandContext.getSession(DbSqlSession.class).selectById(PropertyEntity.class,"schema.version");

    String dbVersion = dbVersionProperty.getValue();

    return dbVersion;

    }

});