<commit_before># BPMN Parse Listener

This example demonstrates how to use a BPMN Parse Listener as Process Engine Plugin.
We learn

* How to implement and activate a Process Engine Plugin
* How to implement a BPMN Parse Listener
* How to work with an Execution Listener
* How to use properties as extension elements in BPMN 2.0

After having looked through the code, you will understand the behavior of a BPMN Parse Listener in case of

* An additional parsing to the BPMN Parser in the Process Engine
* The Process Engine Plugin configuration.

## Show me the important parts!

The process model is composed of two tasks:

![Process Model][1]

* ServiceTask 1 and 2: the service task contains custom extension properties.

### Create a Process Engine Plugin Implementation

Extend the `org.camunda.bpm.engine.impl.cfg.AbstractProcessEnginePlugin` abstract class:

``` java
public class ProgressLoggingSupportParseListenerPlugin extends AbstractProcessEnginePlugin {

  @Override
  public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration) {
  
    // 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 ProgressLoggingSupportParseListener());
  }
}
```

### Create a BPMN Parse Listener Implementation

Extend the `org.camunda.bpm.engine.impl.bpmn.parser.AbstractBpmnParseListener` abstract class:

``` java
public class ProgressLoggingSupportParseListener extends AbstractBpmnParseListener {
<commit_msg>chore(bpmn-parse-listener): synchronize README with code<commit_after># BPMN Parse Listener

This example demonstrates how to use a BPMN Parse Listener as Process Engine Plugin.
We learn

* How to implement and activate a Process Engine Plugin
* How to implement a BPMN Parse Listener
* How to work with an Execution Listener
* How to use properties as extension elements in BPMN 2.0

After having looked through the code, you will understand the behavior of a BPMN Parse Listener in case of

* An additional parsing to the BPMN Parser in the Process Engine
* The Process Engine Plugin configuration.

## Show me the important parts!

The process model is composed of two tasks:

![Process Model][1]

* ServiceTask 1 and 2: the service task contains custom extension properties.

### Create a Process Engine Plugin Implementation

Extend the `org.camunda.bpm.engine.impl.cfg.AbstractProcessEnginePlugin` abstract class:

``` java
public class ProgressLoggingSupportParseListenerPlugin extends AbstractProcessEnginePlugin {

  @Override
  public void preInit(ProcessEngineConfigurationImpl processEngineConfiguration { 
    // get all existing preParseListeners
    List<BpmnParseListener> preParseListeners = processEngineConfiguration.getCustomPreBPMNParseListeners();
    
    if(preParseListeners == null) {
      // if no preParseListener exists, create new list
      preParseListeners = new ArrayList<BpmnParseListener>();
      processEngineConfiguration.setCustomPreBPMNParseListeners(preParseListeners);
    }
    
    // add new BPMN Parse Listener
    preParseListeners.add(new ProgressLoggingSupportParseListener());
  }
}
```

### Create a BPMN Parse Listener Implementation

Extend the `org.camunda.bpm.engine.impl.bpmn.parser.AbstractBpmnParseListener` abstract class:

``` java
public class ProgressLoggingSupportParseListener extends AbstractBpmnParseListener {

{'fraction_non_alphanumeric': 0.05725087766675668, 'fraction_numerical': 0.0027005130974885228, 'mean_word_length': 4.916932907348243, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5825708', 'n_tokens_mistral': 971, 'n_tokens_neox': 953, 'n_words': 364}