- String parentName = solver.getName(component.getParent().getModuleId());
- solver.includeSubprocess(parentName, subprocessName);
- component.solverComponentName = subprocessName;
- solverComponentNameToComponent.put(subprocessName, component);
+ int nearestParentId = getNearestParentComponentId(component);
+ if (nearestParentId <= 0) {
+ throw new SynchronizationException("Could not find parent with non-zero component id from Component("+name+", " + (component != null ? component.uid : "null") + "," + typeId + ")");
+ }
+ String parentName = solver.getName(nearestParentId);
+ solver.includeSubprocess(parentName, subprocessName);
+ component.solverComponentName = subprocessName;
+ solverComponentNameToComponent.put(subprocessName, component);