Class ProcessCommand

    • Constructor Detail

      • ProcessCommand

        public ProcessCommand​(ModelElement parent)
        Parameters:
        parent - the parent of the model element
      • ProcessCommand

        public ProcessCommand​(ModelElement parent,
                              java.lang.String name)
        Parameters:
        parent - the parent of the model element
        name - the name for the model element
    • Method Detail

      • execute

        public abstract void execute()
        The execute method is responsible for executing the command
      • getProcessDescription

        public ProcessDescription getProcessDescription()
        Returns a reference to the process description that this command is within
        Returns:
        A reference to the process description for this command
      • addBeforeExecutionListener

        public final void addBeforeExecutionListener​(ProcessCommandListenerIfc listener)
        Adds a listener to be called prior to the execution of the command
        Parameters:
        listener - the listener to add
      • removeBeforeExecutionListener

        public final void removeBeforeExecutionListener​(ProcessCommandListenerIfc listener)
        Removes the listener that is called prior to the execution of the command
        Parameters:
        listener - the listener to remove
      • addAfterExecutionListener

        public final void addAfterExecutionListener​(ProcessCommandListenerIfc listener)
        Adds a listener to be called after the execution of the command
        Parameters:
        listener - the listener to add
      • removeAfterExecutionListener

        public final void removeAfterExecutionListener​(ProcessCommandListenerIfc listener)
        Removes the listener that is called after the execution of the command
        Parameters:
        listener - the listener to remove
      • setProcessDescription

        protected void setProcessDescription​(ProcessDescription processDescription)
        Sets the process description that this command currently is in
        Parameters:
        processDescription - The ProcessDescription
      • execute

        protected final void execute​(ProcessExecutor processExecutor)
        The execute method is responsible for executing the command
        Parameters:
        processExecutor - , a reference to the process executor that is currently executing the command
      • setProcessExecutor

        protected final void setProcessExecutor​(ProcessExecutor processExecutor)
        Sets the process executor that is currently executing the command
        Parameters:
        processExecutor - The ProcessExecutor
      • getProcessExecutor

        protected final ProcessExecutor getProcessExecutor()
        Gets a reference to the process executor that is currently executing this command
        Returns:
        A reference to the process executor.
      • getResumeListener

        protected final EventActionIfc getResumeListener()
        Gets a reference to the ActionListener to resume this command
        Returns:
        A reference to the ActionListener
      • scheduleResume

        protected final void scheduleResume​(ProcessExecutor processExecutor,
                                            double time,
                                            int priority,
                                            java.lang.String eventName)
        This method uses the event scheduling mechanism to schedule the resumption of the process executor
        Parameters:
        processExecutor - the executor
        time - the time until
        priority - the priority
        eventName - the name of the event
      • notifyBeforeExecutionListeners

        protected final void notifyBeforeExecutionListeners()
        Notifies the before execution listeners
      • notifyAfterExecutionListeners

        protected final void notifyAfterExecutionListeners()
        Notifies the before execution listeners