I have a spring application (not boot) that uses java config for the process engine, but also hosts the rest api for the modeler webapp to deploy app definitions. Now with the new AppEngine I needed to deploy the app engine rest services in my application. This works fine, but it only deploys to the act_app tables if not linked to the process engine, which I don’t know how to do.
@Bean
public ProcessEngineConfiguration processEngineConfiguration(DataSource dataSource, PlatformTransactionManager transactionManager) {
SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration();
config.setDataSource(dataSource);
config.setTransactionManager(transactionManager);
... some more config
// configurators
ArrayList<EngineConfigurator> configurators = new ArrayList<>(2);
configurators.add(new SpringFormEngineConfigurator());
configurators.add(new SpringContentEngineConfigurator());
config.setConfigurators(configurators);
... some more config like parse handlers
return config;
}
@Bean
public ProcessEngine processEngine(ProcessEngineConfiguration config) {
return config.buildProcessEngine();
}
So the above configures the process engine, and adding the configurators also hooks up the Form and Content engines.
There is however no SpringAppEngineConfigurator to add to the configurators.
@Bean
public AppEngineConfiguration appEngineConfiguration(ProcessEngine processEngine, ProcessEngineConfiguration processEngineConfiguration, DataSource dataSource, PlatformTransactionManager transactionManager) {
SpringAppEngineConfiguration appEngineConfiguration = new SpringAppEngineConfiguration();
appEngineConfiguration.setDataSource(dataSource);
appEngineConfiguration.setDatabaseSchemaUpdate(AppEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
appEngineConfiguration.setTransactionManager(transactionManager);
appEngineConfiguration.setDisableIdmEngine(true);
// THIS AT LEAST DEPLOYS TO FORM ENGINE
appEngineConfiguration.setConfigurators(processEngineConfiguration.getConfigurators());
return appEngineConfiguration;
}
@Bean
public AppEngineFactoryBean appEngineFactoryBean(AppEngineConfiguration appEngineConfiguration) {
AppEngineFactoryBean factoryBean = new AppEngineFactoryBean();
factoryBean.setAppEngineConfiguration(appEngineConfiguration);
return factoryBean;
}
@Bean
public AppEngine appEngine(AppEngineFactoryBean appEngineFactoryBean) {
try {
return appEngineFactoryBean.getObject();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
So while I can grab the other configurators from the processEngineConfiguration and it does deploy to the form engine, I can’t get deployment of processes working.
I have also tried: appEngineConfiguration.setCustomPostDeployers(Arrays.asList(new BpmnDeployer()));
But gets NullPointer here: CommandContextUtil.getProcessEngineConfiguration().getRepositoryService();
I don’t understand enough of the guts here to know where to plug it in.