Error of boundary event is lost when converting to xml

Hello,
I try to deploy a bpmn model that has an error for an error boundary event but when I try to get file back the model doesn’t have the error anymore.
I tried also with this file also: https://github.com/flowable/flowable-engine/blob/3cc4d5e225c7ab2ccbba5f95b9441c842f743307/modules/flowable-app-rest/src/main/resources/reviewSalesLead.bpmn20.xml#L11
I deploy my file like this:

Deployment deployment = repositoryService.createDeployment()
                .addBpmnModel(resourceName, model)
                .deploy();

and I am retrieving it like this:

repositoryService.getProcessModel(processDefinitionId)

I’ve noticed that inside DeploymentBuilderImpl.class here:

public DeploymentBuilder addBpmnModel(String resourceName, BpmnModel bpmnModel) {
        BpmnXMLConverter bpmnXMLConverter = new BpmnXMLConverter();
        String bpmn20Xml = new String(bpmnXMLConverter.convertToXML(bpmnModel), StandardCharsets.UTF_8);
        addString(resourceName, bpmn20Xml);
        return this;
    }

My error is present at bpmn model but it’s not present at bpmn20Xml string.

Hi desp.kaz, i suggest double-checking your error setup to ensure everything is properly defined, . this often happens if the error event definition isn’t fully configured (bs: missing a valid error code).

Hello Pavelevich,
what do you mean a valid error code? That this error is not present at the file?
At the example that I’ve pasted the boundary event is like this:


 <boundaryEvent attachedToRef="reviewSalesLeadSubProcess" cancelActivity="true" id="catchNotEnoughInformationError" >
         <errorEventDefinition errorRef="notEnoughInfoError" />
      </boundaryEvent>

and there is an error

<error id="notEnoughInfoError" errorCode="not_enough_info" />

So, the errorRef of the event matches the error id. Is there anything else that should be done?

:face_with_monocle: check that your boundary event’s errorRef references an actual <error> definition declared under the root <definitions> (with matching IDs)

As I said before I’ve tried that: flowable-engine/modules/flowable-app-rest/src/main/resources/reviewSalesLead.bpmn20.xml at 3cc4d5e225c7ab2ccbba5f95b9441c842f743307 · flowable/flowable-engine · GitHub

which indeed has an error definition under definitions and the error ref of the boundary event has the same value of error id.
Do you mean something else?