Programatically add processEngine plugin

Hello
In camunda documentation (here) you claim it is possible to configure a plugin programatically. I was not able to find how it can be done.

Please could you give me a hint.

Thanx

1 Like

Hi,

the example shows how to add the CamundaReactor Plugin to a SpringProcesssEngineConfiguration. Hope this will help

SpringProcessEngineConfiguration conf = new SpringProcessEngineConfiguration();
List<ProcessEnginePlugin> processEnginePlugins = new ArrayList<>();
processEnginePlugins.add(CamundaReactor.plugin());
conf.setProcessEnginePlugins(processEnginePlugins);

Best regards,

Markus

1 Like

Is it possible to do that on a running process engine? I tried something like this:

 List<ProcessEnginePlugin> config = ((ProcessEngineConfigurationImpl)processEngine.getProcessEngineConfiguration()).getProcessEnginePlugins();
 config.add(new FileTypeFieldPlugin());
 ((ProcessEngineConfigurationImpl)processEngine.getProcessEngineConfiguration()).setProcessEnginePlugins(config);

But the preInit method of the plugin is newer called.

Hi @Adam_Klima,

Plugins should be registered before the process engine is built. Afterwards you are not going to receive any callbacks.

Cheers,
Thorben

2 Likes