SalesPoint Framework v3.1

sale
Interface Transition

All Superinterfaces:
Serializable
All Known Implementing Classes:
GateChangeTransition

public interface Transition
extends Serializable

An edge in the graph representing the deterministic finite automaton implementing a process.

Transitions are where the actual work of the process is done. Although very short, Transitions will be the parts of your processes that take the real hard design bits. Transitions should be rather short, in particular they must not comprise user communication or other potentially infinite activities. As a balance, transitions are guaranteed never to be interrupted by the Framework.

In contrast, gates are the points at which user communication can 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.

Since:
v2.0
Author:
Steffen Zschaler

Method Summary
 Gate perform(SaleProcess pOwner, User usr)
          Actually perform the transition.
 

Method Detail

perform

public Gate perform(SaleProcess pOwner,
                    User usr)
Actually perform the transition.

This is the key method of the Transition and should contain any code that is necessary to transit from one gate to another. The new gate that should be entered after this transition must be returned by this method. null is a valid return value and will stop the calling process.

This method must not trigger any user communication or any other potentially infinite operation. Potentially infinite means, in this context, that the end of the operation cannot be planned ahead, but can potentially be at any time in the future, usually further in the future, possibly even never. An example for potentially infinite operations are all operations that comprise user communication and, therefore, the potential that the user just "forgets" to respond. As transitions are guaranteed to be uninteruptible by the Framework, but processes are to be interruptible, transitions must, as a consequence, be very short and not comprise any potentially infinite operations.

Parameters:
pOwner - the process that triggered the Transition
usr - the user currently active in the process' ProcessContext
Returns:
the gate to enter after this transition has completed. null is a valid value, causing the calling process to stop.
Override:
Always

SalesPoint Framework v3.1