Wrong implementation of BPM evaluator according to subprocesses

Hi, I am not sure about this as I dont have sources of BPM addon(cant debug bpm-core), but probably there is problem in ExtensionElementsManagerBean in method getStartExtensionElements, where you check number of StartEvents to be eq 1.
Replication:

  1. Create BPM Model with subprocess eg. attached picture
    1.1. deploy model
  2. Create entity with bpm integration

procActionsFrame.initializer().setBeforeStartProcessPredicate(this::commit).setAfterStartProcessListener(() -> {
    showNotification(getMessage("Process started"), NotificationType.HUMANIZED);
    close(COMMIT_ACTION_ID);
}).setBeforeCompleteTaskPredicate(this::commit).setAfterCompleteTaskListener(() -> {
    showNotification(getMessage("Task completed"), NotificationType.HUMANIZED);
    close(COMMIT_ACTION_ID);
}).setBeforeClaimTaskPredicate(this::commit).init("testcase", getItem());
  1. Start process -> you will get com.haulmont.bpm… error about having more than 1 StartEvent

com.haulmont.bpm.exception.BpmException: Cannot process process with multiple start events
  1. Remove StartEvent from bpm model and redeploy it
  2. Start process -> you will get activiti error

ActivitiException: No initial activity found for subprocess sid-D07920DD-1C64-469A-B89C-E16E2733A57F

I am not sure if this is wrong design of mine or bug of BPM addon, thank you for any advice.

Capture

Temporary fix.

  1. create bean in core package

import com.haulmont.bpm.core.ExtensionElementsManagerBean;
import com.haulmont.bpm.exception.BpmException;
import org.activiti.bpmn.model.BpmnModel;
import org.activiti.bpmn.model.ExtensionElement;
import org.activiti.bpmn.model.StartEvent;

import java.util.List;
import java.util.Map;

public class MyCustomExtensionElementsManagerBean extends ExtensionElementsManagerBean {

    @Override
    public Map<String, List<ExtensionElement>> getStartExtensionElements(String actProcessDefinitionId) {

        BpmnModel bpmnModel = repositoryService.getBpmnModel(actProcessDefinitionId);
        List<StartEvent> startEvents = bpmnModel.getMainProcess().findFlowElementsOfType(StartEvent.class);
        if (startEvents.size() == 0) {
            throw new BpmException("Cannot start process without start events");
        }
        StartEvent startEvent = startEvents.get(0);
        return startEvent.getExtensionElements();
    }
}
  1. In core spring.xml add line

    <bean id="bpm_ProcessRuntimeManager" class="your.package.MyCustomProcessRuntimeManagerBean"/>

Hi!
It seems that this is a bug. We created an issue. Thanks for reporting!

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-9200