Hello, I am trying to implement parse listener with spring boot starter and somehow i am not able to make it work. Any help would be greatly appreciated.
Here is what i have tried so far. Please note that i have very basic Spring Boot application without any customization and trying to add plugin to default process engine configuration instead of changing or overriding it.
When i created spring boot application it didn’t create camunda.cfg.xml file so i created new one in resources/META-INF folder like below. Am i making any mistake here?
Also, couldn’t find default camunda.cfg.xml for spring boot application. is there one out there?
I tried that option as well. my bean implementation looks like below. ProgressModelParseListenerPlugin is the class that extends AbstractProcessEnginePlugin
@Configuration
public class ProcessEnginePluginConfiguration {
@Bean
@Order(Ordering.DEFAULT_ORDER + 1)
public static ProcessEnginePlugin myProcessEnginePluginConfiguration() {
return new ProgressModelParseListenerPlugin();
}
I am sure i am making some silly mistake but new to camunda so struggling to figure it out.
I was able to register bean like below but now my parse listener is not getting triggered. Do parse listener and execution listener has to be @Component as well?
@Component @Order(Ordering.DEFAULT_ORDER + 1)
public class ProgressModelParseListenerPlugin extends AbstractProcessEnginePlugin {
private static final Logger LOGGER = LoggerFactory.getLogger(ProgressModelParseListenerPlugin.class);
@Override
public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
LOGGER.debug("inside preInit");
// get all existing preParseListeners
List < BpmnParseListener > preParseListeners = processEngineConfiguration.getPreParseListeners();
if (preParseListeners == null) {
// if no preParseListener exists, create new list
preParseListeners = new ArrayList < BpmnParseListener > ();
processEngineConfiguration.setPreParseListeners(preParseListeners);
}
// add new BPMN Parse Listener
preParseListeners.add(new ProgressModelParseListener());
}
Is it possible to have multiple ProcessEnginePlugin configuration classes, and choose which one to use when starting a process from the RuntimeService (java)?
Right now I am starting a process using Springboot in the following way: