I’m facing an issue with starting a Flowable process programmatically when receiving a JMS message via a JobHandler
. Here’s the flow I am implementing:
ProcessInstance ex = CommandContextUtil
.getProcessEngineConfiguration(commandContext)
.getRuntimeService()
.startProcessInstanceByKey(config.getProcessDefinitionKey(), config.getVariables());
However, this doesn’t seem to start the process as expected. Instead, I get the following error:
org.flowable.common.engine.api.FlowableException: Error sending message event
Caused by: org.flowable.common.engine.api.FlowableException: Execution with id 'PRC-ffb6f7bd-1560-11f0-9c93-e2a237908fae' does not have a subscription to a message event with name <message_name>
When I manually start the process via an endpoint like this:
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(
model.getProcessDefinitionKey(), model.getVariables());
The process starts successfully, and the subscriptions for message events are added. After that, when the message event is received, it gets processed properly. However, when starting the process programmatically upon receiving the JMS message, the process doesn’t appear to subscribe to the message events, and I get the error mentioned above.
Environment:
- Java Version: 17
- Flowable Version: 6.8.1
- Spring Version: 2.6.6