Autolayout fails with subprocess data objects

Description

We are migrating our templates from a proprietary xml format to bpmn 2.0. I am reusing the auto-layout code to add the BPMNDI values. The autolayout code attempts to create graphic info for data objects in subprocesses and fails with a NPE, but skips them for the main process. The code should also skip DataObjects for subprocesses.

for (FlowElement subProcessElement : subProcess.getFlowElements()) {
if (subProcessElement instanceof SequenceFlow) {
List<GraphicInfo> graphicInfoList = bpmnModel.getFlowLocationGraphicInfo(subProcessElement.getId());
for (GraphicInfo graphicInfo : graphicInfoList) {
graphicInfo.setX(graphicInfo.getX() + translationX);
graphicInfo.setY(graphicInfo.getY() + translationY);
}
} else if (subProcessElement instanceof DataObject == false) {
GraphicInfo graphicInfo = bpmnModel.getLocationMap().get(subProcessElement.getId());
graphicInfo.setX(graphicInfo.getX() + translationX);
graphicInfo.setY(graphicInfo.getY() + translationY);
}

Environment

None

Assignee

Tijs Rademakers

Reporter

Lori Small

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure