// compatibility fix: boundary events should always occur at the bottom
// otherwise they will be drawn at an incorrect position on load
static void addChildElement(
            BasePropertyWriter p,
            Map<String, BasePropertyWriter> childElements,
            FlowElementsContainer process,
            Collection<ElementParameters> simulationParameters,
            List<ItemDefinition> itemDefinitions,
            List<RootElement> rootElements) {
        childElements.put(p.getElement().getId(), p);
        if (p.getElement() instanceof FlowElement) {
            // compatibility fix: boundary events should always occur at the bottom
            // otherwise they will be drawn at an incorrect position on load
            if (p instanceof BoundaryEventPropertyWriter) {
                process.getFlowElements().add((FlowElement) p.getElement());
            } else {
                process.getFlowElements().add(0, (FlowElement) p.getElement());
                p.getElement();
            }
        } else if (p.getElement() instanceof Artifact) {
            if (process instanceof Process) {
                ((Process) process).getArtifacts().add((Artifact) p.getElement());
            } else if (process instanceof SubProcess) {
                ((SubProcess) process).getArtifacts().add((Artifact) p.getElement());
            }
        }
        if (p instanceof PropertyWriter) {
            ElementParameters sp = ((PropertyWriter) p).getSimulationParameters();
            if (sp != null) {
                simulationParameters.add(sp);
            }
        }
        itemDefinitions.addAll(p.getItemDefinitions());
        rootElements.addAll(p.getRootElements());
        rootElements.addAll(p.getInterfaces());
    }
childElements.put(p.getElement().getId(), p);
if (p.getElement() instanceof FlowElement) {
// compatibility fix: boundary events should always occur at the bottom
// otherwise they will be drawn at an incorrect position on load
if (p instanceof BoundaryEventPropertyWriter) {
process.getFlowElements().add((FlowElement) p.getElement());
static void addChildElement(
BasePropertyWriter p,
Map<String, BasePropertyWriter> childElements,
FlowElementsContainer process,
Collection<ElementParameters> simulationParameters,
List<ItemDefinition> itemDefinitions,
List<RootElement> rootElements) {
childElements.put(p.getElement().getId(), p);
if (p.getElement() instanceof FlowElement) {
// compatibility fix: boundary events should always occur at the bottom
// otherwise they will be drawn at an incorrect position on load
if (p instanceof BoundaryEventPropertyWriter) {
process.getFlowElements().add((FlowElement) p.getElement());
} else {
process.getFlowElements().add(0, (FlowElement) p.getElement());
p.getElement();
}
} else if (p.getElement() instanceof Artifact) {
if (process instanceof Process) {
((Process) process).getArtifacts().add((Artifact) p.getElement());
} else if (process instanceof SubProcess) {
static void addChildElement(
BasePropertyWriter p,
Map<String, BasePropertyWriter> childElements,
FlowElementsContainer process,
Collection<ElementParameters> simulationParameters,
List<ItemDefinition> itemDefinitions,
List<RootElement> rootElements) {
childElements.put(p.getElement().getId(), p);
if (p.getElement() instanceof FlowElement) {
// compatibility fix: boundary events should always occur at the bottom
// otherwise they will be drawn at an incorrect position on load
if (p instanceof BoundaryEventPropertyWriter) {
process.getFlowElements().add((FlowElement) p.getElement());
} else {
process.getFlowElements().add(0, (FlowElement) p.getElement());
p.getElement();
}
} else if (p.getElement() instanceof Artifact) {
if (process instanceof Process) {
((Process) process).getArtifacts().add((Artifact) p.getElement());
} else if (process instanceof SubProcess) {
((SubProcess) process).getArtifacts().add((Artifact) p.getElement());
}
}
if (p instanceof PropertyWriter) {
ElementParameters sp = ((PropertyWriter) p).getSimulationParameters();
if (sp != null) {
simulationParameters.add(sp);
}
}
itemDefinitions.addAll(p.getItemDefinitions());