/** creates the given event on the current process element. * This method requires a process element. A process element is * either a process definition or a node. This method doesn't need to be * called for transitions. If you have exception handlers and listeners * on an event, make sure that you put the invocations of * {@link #exceptionHandler(Class)} first. */ public ProcessFactory event(String eventName) { if (exceptionHandler!=null) { throw new PvmException("exceptionHandler needs to be closed with exceptionHandlerEnd"); } if (observableElement==null) { throw new PvmException("no current process element"); } if (observableElement instanceof Transition) { throw new PvmException("for actions on transitions, you don't need to call event"); } event = observableElement.createEvent(eventName); exceptionHandler = null; return this; }