Source:
<code>protected Transition createInitialTransition(Region region, Vertex source, Vertex target, IProgressMonitor monitor, IAdaptable info, String firstTransitionName) throws ExecutionException { EObject newElement = null; CreateElementRequest createElementRequest = new CreateElementRequest(region, UMLElementTypes.TRANSITION); IElementEditService provider = ElementEditServiceUtils.getCommandProvider(region); if (provider == null) { throw new ExecutionException("Impossible to get the provider from " + region); } ICommand createGMFCommand = provider.getEditCommand(createElementRequest); if (createGMFCommand != null) { if (createGMFCommand.canExecute()) { IStatus status = createGMFCommand.execute(monitor, info); if (status.isOK()) { newElement = GMFCommandUtils.getCommandEObjectResult(createGMFCommand); if (!(newElement instanceof Transition)) { throw new ExecutionException("Element creation problem for " + <START> UMLElementTypes.TRANSITION.getDisplayName() + <END> "."); } ((Transition) newElement).setName(firstTransitionName); if (source != null) { ((Transition) newElement).setSource(source); } if (target != null) { ((Transition) newElement).setTarget(target); } ((Transition) newElement).setName(firstTransitionName); return ((Transition) newElement); } else { throw new ExecutionException("Impossible to create the initial Transition"); } } else { throw new ExecutionException("Command to create initial Transition is not executable"); } } else { throw new ExecutionException("Impossible to find a command to create the initial Transition"); } }</code><technical_language>For simplification reasons, I prefer word "transition" UMLElementTypes.XXX.getDisplayName(). I issues UMLElementTypes constants, do support loading / unloading of element types is proposed in Papyrus. I suspect evolution of UMLElementTypes classes generation for next version of Papyrus</technical_language>

Target:
protected Transition createInitialTransition(Region region, Vertex source, Vertex target, IProgressMonitor monitor, IAdaptable info, String firstTransitionName) throws ExecutionException { EObject newElement = null; CreateElementRequest createElementRequest = new CreateElementRequest(region, UMLElementTypes.TRANSITION); IElementEditService provider = ElementEditServiceUtils.getCommandProvider(region); if (provider == null) { throw new ExecutionException("Impossible to get the provider from " + region); } ICommand createGMFCommand = provider.getEditCommand(createElementRequest); if (createGMFCommand != null) { if (createGMFCommand.canExecute()) { IStatus status = createGMFCommand.execute(monitor, info); if (status.isOK()) { newElement = GMFCommandUtils.getCommandEObjectResult(createGMFCommand); if (!(newElement instanceof Transition)) { throw new ExecutionException("Element creation problem for Transition " + "."); } ((Transition) newElement).setName(firstTransitionName); if (source != null) { ((Transition) newElement).setSource(source); } if (target != null) { ((Transition) newElement).setTarget(target); } return ((Transition) newElement); } else { throw new ExecutionException("Impossible to create the initial Transition"); } } else { throw new ExecutionException("Command to create initial Transition is not executable"); } } else { throw new ExecutionException("Impossible to find a command to create the initial Transition"); } }