@Override
public Object[] create(ICreateContext context) {
BoundaryEvent event = null;
try {
Activity activity = (Activity) getBusinessObjectForPictogramElement(context.getTargetContainer());
ModelHandler handler = ModelHandler.getInstance(getDiagram());
event = ModelHandler.FACTORY.createBoundaryEvent();
// event.setId(EcoreUtil.generateUUID());
event.setAttachedToRef(activity);
event.setName("Boundary event");
event.setCancelActivity(true); // by default is interrupting
Object bo = getBusinessObjectForPictogramElement(context.getTargetContainer());
if (bo instanceof FlowElementsContainer) {
bo = getBusinessObjectForPictogramElement((PictogramElement) context.getTargetContainer().eContainer());
}
handler.addFlowElement(bo, event);
} catch (IOException e) {
Activator.logError(e);
}
addGraphicalRepresentation(context, event);
ModelUtil.setID(event);