# Create Subprocess with Error StartEvent

**URL:** <https://forum.bpmn.io/t/create-subprocess-with-error-startevent/6297>\
**Category:** Modeler\
**Created:** [May 31, 2021, 5:03am UTC](https://forum.bpmn.io/t/create-subprocess-with-error-startevent/6297 "2021-05-31T05:03:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian-Bielefeldt](https://forum.bpmn.io/user_avatar/forum.bpmn.io/adrian-bielefeldt/32/3503_2.png) [@Adrian-Bielefeldt](https://forum.bpmn.io/u/Adrian-Bielefeldt)\
**Post date:** [May 31, 2021, 5:03am UTC](https://forum.bpmn.io/t/create-subprocess-with-error-startevent/6297/1 "2021-05-31T05:03:57Z")

</div>

Hello everyone,

I would like to modifiy the default palette entry for sub-processes to start with an Error-StartEvent instead of a StartEvent. I have created my own palette and know that the function to modify is createSubprocess:

```auto
  function createSubprocess(event) {
  var subProcess = elementFactory.createShape({
    type: 'bpmn:SubProcess',
    x: 0,
    y: 0,
    isExpanded: true,
  });
  subProcess.businessObject.triggeredByEvent = true;

  var startEvent = elementFactory.createShape({
    type: 'bpmn:StartEvent',
    x: 40,
    y: 82,
    parent: subProcess,
    eventDefinitionType: 'bpmn:ErrorEventDefinition'
  });

  create.start(event, [subProcess, startEvent], {
    hints: {
      autoSelect: [startEvent]
    }
  });
  }

```

As you can see I am setting the ErrorEventDefinition in the createShape-Method for StartEvent. This does have the effect that I can see an Error-StartEvent when dragging the SubProcess into the diagram and hovering. However, when I drop it, it turns into a normal StartEvent.

I presume what happens is that the StartEvent is created, notices that it is not part of a SubProcess and reverts to a standard StartEvent, similar to what happens when you drop an Error-StartEvent into an empty diagram. However, this is obviously not the behaviour I am looking for.

Is this a bug, or should I be setting the eventDefinitionType elsewhere?

---

<div class="post-metadata">

**Author:** ![Victor](https://forum.bpmn.io/user_avatar/forum.bpmn.io/victor/32/2487_2.png) [@Victor](https://forum.bpmn.io/u/Victor)\
**Post date:** [June 2, 2021, 11:17am UTC](https://forum.bpmn.io/t/create-subprocess-with-error-startevent/6297/2 "2021-06-02T11:17:15Z")

</div>

I have (at least it looks like) the same situation with non-interrupting Message StartEvent.  
If I’ve fill everything as it should, MessageStartEvent converts to the stadard StartEvent when SubProcess is placed.

But there is a little bit different configuration differences and as a result, different workarounds.  
But I guess, the root of the problem is the same.

> [@Add Message Start Event (non-interrupting) inside SubTask by-default](https://forum.bpmn.io/t/add-message-start-event-non-interrupting-inside-subtask-by-default/6302/4):
>
> In this case (isInterrupting: false instead of isInterrupting: ‘false’): When I dragging (ie not placed yet) the SubTask, it looks like: [image] And when I placed it looks like: [image] In XML: [image] Currently I’m using following versions: "bpmn-js": "8.1.0", "bpmn-js-properties-panel": "0.38.1", "camunda-bpmn-moddle": "4.5.0", "diagram-js": "7.1.0", So, as you can see, if I pass to the “isInterrupting” property “false” as a boolean value, it even won’t write to the XM…

---

<div class="post-metadata">

**Author:** ![nikku](https://forum.bpmn.io/user_avatar/forum.bpmn.io/nikku/32/5130_2.png) [@nikku](https://forum.bpmn.io/u/nikku)\
**Post date:** [July 22, 2025, 3:38pm UTC](https://forum.bpmn.io/t/create-subprocess-with-error-startevent/6297/3 "2025-07-22T15:38:29Z")

</div>

Closed on July 22, 2025, 3:38pm UTC


