Can not start process with processDefinitionKey beginning with number via REST API

Use flowable-modeller to create a model with a model key of 123 (flowable-modeller displays Process identifier: 123) and deploy it to flowable-task.

Now try to start the process with:

POST http://localhost:8080/flowable-task/process-api/runtime/process-instances
{"processDefinitionKey":"123","businessKey":42811,"returnVariables":true,"variables":[{"name":"myvar","value":"42811"}]}

this results in:

{"message":"Bad request","exception":"No process definition found for key '123'"}

When I query http://localhost:8080/flowable-task/process-api/repository/process-definitions I see that the key (key "a123") is prefixed with an a.

Using this key the process can be started successfully.

Is the a prefixing a bug or a feature?

Hi Pascal.

‘a’ prefix is added in the modeler org.flowable.ui.modeler.service.ModelServiceImpl#getBpmnXML(org.flowable.bpmn.model.BpmnModel).

I do not know. Prefix is added since the initial commit.

Regards
Martin

Hi Martin,

thank you very much.

I created a patched flowable-modeler without the code in org.flowable.ui.modeler.service.ModelServiceImpl#getBpmnXML(org.flowable.bpmn.model.BpmnModel).

When I try to deploy the model, the following exception occurs:

Caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '123' is not a valid value for 'NCName'.
        at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
        at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.0.jar:2.12.0]
        at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.jaxp.validation.StAXValidatorHelper$StreamHelper.validate(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.jaxp.validation.StAXValidatorHelper.validate(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at org.apache.xerces.jaxp.validation.ValidatorImpl.validate(Unknown Source) ~[xercesImpl-2.12.0.jar:?]
        at javax.xml.validation.Validator.validate(Validator.java:124) ~[?:1.8.0_152]
        at org.flowable.bpmn.converter.BpmnXMLConverter.validateModel(BpmnXMLConverter.java:223) ~[flowable-bpmn-converter-6.5.0-SNAPSHOT.jar:6.5.0-SNAPSHOT]
        at org.flowable.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:267) ~[flowable-bpmn-converter-6.5.0-SNAPSHOT.jar:6.5.0-SNAPSHOT]

According to the BPMN XML schema the process id must start with an underscore or a letter, so the prefix is a feature.

1 Like