Hi. I’m trying to write unit tests for my JavaDelegate but an unable to run JUnit 4 test with FlowableRule.
Exception:
org.flowable.engine.common.api.FlowableObjectNotFoundException: no processes deployed with key ‘myProcess’
Test:
@Test
@Deployment (resources = {"org/flowable/MyProcess.bmpn20.xml"})
public void canStartProcessAndExecuteTask() throws Exception
{
RuntimeService runtimeService = FlowableRule.getRuntimeService();
runtimeService.startProcessInstanceByKey("myProcess");
}
BPMN:
<process id="myProcess" name="My Process" isExecutable="true">
<startEvent id="startEvent"/>
<sequenceFlow sourceRef="startEvent" targetRef="endEvent" />
<endEvent id="endEvent"/>
</process>
In the logs I see:
- — starting DeployCmd --------------------------------------------------------
…
Preparing: insert into ACT_RE_DEPLOYMENT
… - <== Updates: 1
…
Preparing: insert into ACT_GE_BYTEARRAY
… - <== Updates: 1
… - — DeployCmd finished --------------------------------------------------------
- — starting StartProcessInstanceCmd --------------------------------------------------------
… - ==> Preparing: select * from ACT_RE_PROCDEF
… - <== Total: 0
… - — StartProcessInstanceCmd finished --------------------------------------------------------
i.e. the DeployCmd inserts to ACT_RE_DEPLOYMENT and ACT_GE_BYTEARRAY, but the StartProcessInstanceCmd selects from ACT_RE_PROCDEF.
Seems like an insert to ACT_RE_PROCDEF is missing from Deploy.
What am I missing?
Thanks.