cancel
Showing results for 
Search instead for 
Did you mean: 

How do we load an existing (deployed) process ?

gbm
Champ in-the-making
Champ in-the-making
This may be a naive question, but I couldn't find how to solve this.

I get the process engine instance by this :


ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault()
        .buildProcessEngine();
    RepositoryService repositoryService = processEngine.getRepositoryService();
    RuntimeService runtimeService = processEngine.getRuntimeService();


However, everytime I need to do this, I will have to delete my tables as the first line fails with error 'tables already exist' (which of course were created when I ran it the first time).

How can I load the processEngine from database ?

Thanks
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I will have to delete my tables as the first line
Check databaseSchemaUpdate property in the config file (Is it set to create? - that's the reason why activiti tries to recreate tables)

How can I load the processEngine from database ?
You just need to point to the correct DB and configure engine to do not try to recreate tables again

regards
Martin

hari
Star Contributor
Star Contributor
Try this

<code>
   ProcessEngine processEngineInstance = ProcessEngineConfiguration
     .createStandaloneProcessEngineConfiguration()
     .setJdbcDriver(props.getProperty("JdbcDriver"))
     .setJdbcUrl(props.getProperty("url"))
     .setJdbcPassword(props.getProperty("JdbcPassword"))
     .setJdbcUsername(props.getProperty("JdbcUsername"))
     .buildProcessEngine();
</code>

gbm
Champ in-the-making
Champ in-the-making
Thanks. It worked.