Unexpected behavior when exporting CMMN model from flowable-modeler and flowable-design

I have the following CMMN model:

The CMMN exported by flowable-modeler is the following

<case id="assessmentEvaluation" name="Assessment evaluation" flowable:initiatorVariableName="initiator">
    <casePlanModel id="onecaseplanmodel1" name="Case plan model" flowable:formFieldValidation="false">
      <planItem id="planItem4" name="In analysis" definitionRef="inAnalysisStage"></planItem>
      <stage id="inAnalysisStage" name="In analysis">
        <planItem id="planItem1" name="Risk analysis" definitionRef="riskAnalysis">
          <itemControl>
            <requiredRule></requiredRule>
          </itemControl>
        </planItem>
        <planItem id="planItem2" name="Request information for client" definitionRef="userEventListener1"></planItem>
        <planItem id="planItem3" name="Register client information" definitionRef="registerClientInformation">
          <entryCriterion id="entryCriterion2" flowable:sentryRef="sentry1"></entryCriterion>
        </planItem>
        <sentry id="sentry1">
          <planItemOnPart id="sentryOnPart1" sourceRef="planItem2">
            <standardEvent>complete</standardEvent>
          </planItemOnPart>
        </sentry>
        <humanTask id="riskAnalysis" name="Risk analysis" flowable:formFieldValidation="true"></humanTask>
        <userEventListener id="userEventListener1" name="Request information for client"></userEventListener>
        <humanTask id="registerClientInformation" name="Register client information" flowable:formFieldValidation="true"></humanTask>
      </stage>
    </casePlanModel>
  </case>

If I try and deploy this model using Flowable’s Java Engine (6.5.0), it throws an error:
org.flowable.common.engine.api.FlowableException: No sentry found for reference null of entry criterion entryCriterion2

After digging for a while, I found that CriterionXmlConverter.java is looking for the attribute “sentryRef” in the default namespace, which doesn’t match the namespace created by the flowable-modeler.

I’ve tried using flowable-design (3.5.0) and it also exports with “flowable” namespace.
On flowable-modeler 6.4.2, it exports with the default namespace.

Is there any way to make flowable-modeler (and flowable-design) export with the default namespace ?

The code that fetches the sentryRef attribute is the following:
criterion.setSentryRef(xtr.getAttributeValue(null, CmmnXmlConstants.ATTRIBUTE_SENTRY_REF));

The javadoc states

If the namespaceURI is null the namespace is not checked for equality

So the namespace actually doesn’t matter here, it’s always found. Which makes me wonder how you got to that exception? Which environment/JDK are you running this on?

The export logic has been changed here: https://github.com/flowable/flowable-engine/commit/a8ce890a5f01e233f9c32031985cb759f99db760, so that it’s now exported under the default namespace. However, I’m still wondering how that exception you see is happening.

@DavidPLamas can you please check if you have some stax dependency in your dependency tree?

Recently we had a similar issue when a non compliant implementation of the XMLInputFactory was being used. Can you check which XMLInputFactory is being used?

@filiphr The XMLInputFactory being used is com.ctc.wstx.stax.WstxInputFactory. Is this the expected implementation ?

@joram I’m using jdk1.8.0_161.
I’ve to that exception by debugging what was happening behind the scenes when deploying a cmmn model.

No WstxInputFactory is not the expected factory. The default one from java is com.sun.xml.internal.stream.XMLInputFactoryImpl. I think that the Wstx one you have is from woodstox-core Looking at the image it is version 5.0.3 from 2016, which has some bugs in this exact place.

Can you please check how that one got in? Are you using jackson-dataformat-xml by any chance? Are you using some cxf dependencies as well? Please check your dependency tree to verify why 5.0.3 is there and who is pulling it. Flowable doesn’t depend on that dependency.

Yes I’m using both jackson-dataformat-xml 2.8.2 (a direct dependency) and cxf (provided by another dependency).
Upgrading to jackson’s 2.9.10 which brings Woodstox 5.3.0 has fixed my problem.

Thank you both for your help!