SalesPoint Framework v3.1

sale
Interface Gate

All Superinterfaces:
Serializable
All Known Implementing Classes:
UIGate

public interface Gate
extends Serializable

A node in the graph representing the deterministic finite automaton implementing a process.

Gates are the points at which user communication and control flow branching take place. A process can stay at a gate as long as may be necessary, but must be aware that it can be interrupted and suspended at any time. In contrast, a process can never be interrupted when in a Transition, but transitions must be very short and must not comprise any user communication.

As every process begins and ends at a gate, there are special gates for special occasions. See the getXXXGate() methods in SaleProcess.

Since:
v2.0
Author:
Steffen Zschaler

Method Summary
 Transition getNextTransition(SaleProcess pOwner, User usr)
          Determine the next Transition.
 

Method Detail

getNextTransition

public Transition getNextTransition(SaleProcess pOwner,
                                    User usr)
                             throws InterruptedException
Determine the next Transition.

This is the key (and sole) method of the gate. By entering this method, the calling process enters the gate. This method must do anything that is necessary to determine the next transition and must then return this transition. It is invalid, to return a null transition, except in the special cases noted below.

The method must be interruptible by calls to Thread.interrupt() on the executing thread and it must propagate these interrupts as a InterruptedException. In this case it is obviously no problem, if the method returns a null transition.

Also, if any other exception causes the method to be left, or in the case of an explicit call to the process' SaleProcess.error(int) method, the result may be null.

Parameters:
pOwner - the process that entered the gate and triggered the method.
usr - the user currently active in the process' ProcessContext
Returns:
the Transition to be performed after leaving the gate.
Throws:
InterruptedException - if an interrupt ocurred while at the gate.
Override:
Always

SalesPoint Framework v3.1