AnsweredAssumed Answered

Process with many nonestart events with different initiators

Question asked by udoderk on Jan 14, 2013
Latest reply on Jan 15, 2013 by udoderk
Greeting activiti friends :)

Some business process has a many none start events, that ordered to different swim lanes. In other words each none start event can be started by one and only one initiator like that "diagram":
_________________________________________________________________
(start event 1, owner "kermit" )…set of tasks from A to F…..    ————–>   (end event)
__________________________________________________________________…..^
(start event 2, owner "piggy") set of tasks from Cto F…———————————|
__________________________________________________________________

How can i model that process using Activiti (Explorer)?? If i try to deply such process, the deployment will be failed with message "multiple none start events or timer start events not supported on process definition".
That error is set in this method:
org.activiti.engine.impl.bpmn.parser.BpmnParse.selectInitial(List<ActivityImpl>, ProcessDefinitionEntity, Element)
  protected void selectInitial(List<ActivityImpl> startEventActivities, ProcessDefinitionEntity processDefinition, Element parentElement) {
    ActivityImpl initial = null;
    // validate that there is s single none start event / timer start event:
    for (ActivityImpl activityImpl : startEventActivities) {
      if(!activityImpl.getProperty("type").equals("messageStartEvent")) {
        if(initial == null) {
          initial = activityImpl;         
        } else {
          addError("multiple none start events or timer start events not supported on process definition", parentElement);
        }
      }
    }
    // if there is a single start event, select it as initial, regardless of it's type:
    if(initial == null && startEventActivities.size() == 1) {
      initial = startEventActivities.get(0);
    }
    processDefinition.setInitial(initial);
  }

Thanks a lot….

Outcomes