Hi,
I have a process where neither candateStarterGroups nor candateStarterUsers is defined, e.g.:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flowable="http://flowable.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/test">
<process id="my-process">
<startEvent id="start"/>
<sequenceFlow id="flow1" sourceRef="start" targetRef="someTask"/>
<userTask id="someTask" name="Flowable is awesome!"/>
<sequenceFlow id="flow2" sourceRef="someTask" targetRef="end"/>
<endEvent id="end"/>
</process>
</definitions>
When I’m trying to query process definitions startable by some user, I expect to see this process definition, because it has no restrictions on who can start it.
Unit test:
package com.company;
import org.flowable.engine.repository.ProcessDefinition;
import org.flowable.engine.test.Deployment;
import org.flowable.engine.test.FlowableRule;
import org.junit.Rule;
import org.junit.Test;
import java.util.List;
import static org.junit.Assert.assertEquals;
public class MyUnitTest {
@Rule
public FlowableRule flowableRule = new FlowableRule();
@Test
@Deployment(resources = {"my-process.bpmn20.xml"})
public void test() {
List<ProcessDefinition> processDefinitions = flowableRule.getRepositoryService().createProcessDefinitionQuery()
.startableByUser("someUser")
.list();
assertEquals(1, processDefinitions.size());
}
}
But the query with startableByUser("someUser")
condition returns nothing. Such queries return only processes where candidates are explicitly defined. Was it designed this way intentionally or it is a bug? Is there a way to query process definitions where no candidates are defined?