/** @generated */
 public boolean canExecute() {
   OnEvent container = (OnEvent) getElementToEdit();
   if (container.getActivity() != null) {
     return false;
   }
   return true;
 }
  /** @generated */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
      throws ExecutionException {
    Scope newElement = BPELFactory.eINSTANCE.createScope();

    OnEvent owner = (OnEvent) getElementToEdit();
    owner.setActivity(newElement);

    doConfigure(newElement, monitor, info);

    ((CreateElementRequest) getRequest()).setNewElement(newElement);
    return CommandResult.newOKCommandResult(newElement);
  }