FeatureSupport.redraw(context.getTargetContainer());
FeatureSupport.redraw(context.getSourceContainer());
}
private void modifyModelStructure(IMoveShapeContext context) {
Lane movedLane = getMovedLane(context);
Participant targetParticipant = (Participant) getBusinessObjectForPictogramElement(context.getTargetContainer());
try {
ModelHandler handler = ModelHandler.getInstance(getDiagram());
handler.moveLane(movedLane, targetParticipant);
} catch (IOException e) {
Activator.logError(e);
}
Process process = targetParticipant.getProcessRef();
if (process.getLaneSets().isEmpty()) {
LaneSet createLaneSet = ModelHandler.FACTORY.createLaneSet();
// createLaneSet.setId(EcoreUtil.generateUUID());
process.getLaneSets().add(createLaneSet);
ModelUtil.setID(createLaneSet);
}
process.getLaneSets().get(0).getLanes().add(movedLane);
Lane fromLane = (Lane) getBusinessObjectForPictogramElement(context.getSourceContainer());
fromLane.getChildLaneSet().getLanes().remove(movedLane);
if (fromLane.getChildLaneSet().getLanes().isEmpty()) {
fromLane.setChildLaneSet(null);
}
}