public void createObject(int x, int y) {
    if (availableForInsert && this.entry != null) {
      updateCursor(false);
      availableForInsert = false;
      switch (this.entry.getType()) {
        case TRIGGER_BLOCK:
        case CUSTOM_BLOCK:
          CreateUnspecifiedTypeRequest request =
              new CreateUnspecifiedTypeRequest(
                  Collections.singletonList(Neuro4jElementTypes.LogicNode_2017),
                  diagramEditPart.getDiagramPreferencesHint());

          request.setLocation(new Point(x, y));
          Command command = diagramEditPart.getCommand(request);
          command.execute();
          List newObject = (List) request.getNewObject();
          ViewAndElementDescriptor desc = (ViewAndElementDescriptor) newObject.get(0);
          ShapeImpl shape = (ShapeImpl) desc.getAdapter(ShapeImpl.class);
          LogicNode lNode = (LogicNode) shape.getElement();
          updateCustomBlock(lNode, this.entry);
          break;

        case CHILD:
          if (entry.getParent().getType() != ListEntryType.FLOW) {
            return;
          }
          request =
              new CreateUnspecifiedTypeRequest(
                  Collections.singletonList(Neuro4jElementTypes.CallNode_2008),
                  diagramEditPart.getDiagramPreferencesHint());

          request.setLocation(new Point(x, y));
          command = diagramEditPart.getCommand(request);
          command.execute();
          newObject = (List) request.getNewObject();
          desc = (ViewAndElementDescriptor) newObject.get(0);
          shape = (ShapeImpl) desc.getAdapter(ShapeImpl.class);
          CallNode cNode = (CallNode) shape.getElement();

          updateCallBlock(cNode, entry);

          break;

        default:
          break;
      }
      this.entry = null;
    }
  }
  public static void createMessageFlow(
      TransactionalEditingDomain editingDomain,
      Message event,
      ThrowMessageEvent source,
      AbstractCatchMessageEvent target,
      DiagramEditPart dep) {
    EditPart targetEP = findEditPart(dep, target);
    EditPart sourceEP = findEditPart(dep, source);

    CreateConnectionViewAndElementRequest request =
        new CreateConnectionViewAndElementRequest(
            ProcessElementTypes.MessageFlow_4002,
            ((IHintedType) ProcessElementTypes.MessageFlow_4002).getSemanticHint(),
            dep.getDiagramPreferencesHint());
    Command createMessageFlowCommand =
        CreateConnectionViewAndElementRequest.getCreateCommand(request, sourceEP, targetEP);
    if (createMessageFlowCommand.canExecute()) {
      dep.getDiagramEditDomain().getDiagramCommandStack().execute(createMessageFlowCommand);
      dep.getDiagramEditDomain().getDiagramCommandStack().flush();
      dep.refresh();

      ConnectionViewAndElementDescriptor desc =
          (ConnectionViewAndElementDescriptor) request.getNewObject();
      MessageFlow message = (MessageFlow) desc.getElementAdapter().getAdapter(MessageFlow.class);
      SetCommand setCommand =
          new SetCommand(
              editingDomain, message, ProcessPackage.Literals.ELEMENT__NAME, event.getName());
      editingDomain.getCommandStack().execute(setCommand);
    }
  }
 @Override
 protected Request createTargetRequest() {
   // DirectEditRequest request = new DirectEditRequest();
   EPackage epackage =
       org.eclipse.emf.ecore.EPackage.Registry.INSTANCE.getEPackage("http://vespucci.editor");
   Vespucci_modelPackage vesPackage = (Vespucci_modelPackage) epackage;
   IElementType elementType =
       ElementTypeRegistry.getInstance().getElementType(vesPackage.getEnsemble());
   // TODO is there a way to get VespucciElementTypes.Ensemble_2001 over a methode call?
   elementType = VespucciElementTypes.Ensemble_2001;
   // Get the selected edit part
   EditPart epart = getTargetEditPart();
   if (epart == null)
     return new CreateViewRequest(new CreateViewRequest.ViewDescriptor(null, null));
   // GraphicalEditPart p = (GraphicalEditPart) epart;
   DiagramEditPart p = (DiagramEditPart) epart;
   CreateViewRequest request =
       CreateViewRequestFactory.getCreateShapeRequest(elementType, p.getDiagramPreferencesHint());
   request.setType(REQ_DROPNEWENSEMBLE);
   return request;
 }