AnsweredAssumed Answered

ActivitiRule allows multiple occurences of buisnesskey

Question asked by billdoor on Jun 30, 2015
Latest reply on Jun 30, 2015 by jbarrez
Hello,

long story short, i am unittesting a class and ran into unexpected behaivour, i extracted the point into a seperate test:

@Test (expected = IllegalArgumentException.class)
    @Deployment(resources  = {"test_process.bpmn"})
    public void startProcess_duplicateBkey() {
        rule.getRuntimeService().startProcessInstanceByKey("test_process", "a1");
        rule.getRuntimeService().startProcessInstanceByKey("test_process", "a1");

         System.out.println(rule.getRuntimeService().createProcessInstanceQuery().processInstanceBusinessKey("a1", "test_process").list().size());
    }


prints "2".

Why can i have 2 ProcessInstances of the same processdefinition with the same businesskey?

Outcomes