org.apache.agila.services
Interface TokenService

All Known Implementing Classes:
TokenServiceImpl, TokenServiceImpl, TokenServiceImpl

public interface TokenService

Version:
$Id: $
Author:
Geir Magnusson Jr.

Method Summary
 java.util.List getActiveTokensForInstance(InstanceID instanceID)
          Returns all tokens active for a given execution instance of a business process
 java.util.List getParallelTokens(TokenID tokenID)
          Returns a set of tokens that are considered 'parallel' to a given tokenID Parallel tokens are any tokens that can trace their lineage to the first common ancestor N T1 T2 <- parallel tokens N N1 T1 T2 N2 | T3 T4 | N3 | T5 | N4 So N4 asking about T2 could get T1 or T3 and/or T4 or T5, depending on execution timing.
 Token getTokenByID(TokenID tokenID)
          Fetches a token from the token store
 Token newToken(InstanceID instanceID, NodeID nodeID, int tokenState)
          token factory - creates a new token with valid token ID.
 Token[] nextToken(Connection[] connSet, Token parentToken)
          Returns a set of tokens, advanced along the connections given.
 boolean saveToken(Token t)
          Saves the state of a token after modification or update
 

Method Detail

getActiveTokensForInstance

java.util.List getActiveTokensForInstance(InstanceID instanceID)
Returns all tokens active for a given execution instance of a business process

Parameters:
instanceID -
Returns:
list of Token instances for this instances

newToken

Token newToken(InstanceID instanceID,
               NodeID nodeID,
               int tokenState)
token factory - creates a new token with valid token ID. Implementation should persist the token before returning if a persisting implementation

Returns:
new Token associated w/ an instance/node/state

nextToken

Token[] nextToken(Connection[] connSet,
                  Token parentToken)
Returns a set of tokens, advanced along the connections given. The implementation is responsible for tracking 'fork trees', to provide for join resolution in 'getParallelTokens()'

Parameters:
connSet -
parentToken -
Returns:
new tokens resulting from advancing a parent through a set of Connections

saveToken

boolean saveToken(Token t)
Saves the state of a token after modification or update

Parameters:
t -
Returns:
true if successfully saved, false otherwise

getTokenByID

Token getTokenByID(TokenID tokenID)
Fetches a token from the token store

Parameters:
tokenID -
Returns:
toke matching the id, or null if not found

getParallelTokens

java.util.List getParallelTokens(TokenID tokenID)
Returns a set of tokens that are considered 'parallel' to a given tokenID Parallel tokens are any tokens that can trace their lineage to the first common ancestor N T1 T2 <- parallel tokens N N1 T1 T2 N2 | T3 T4 | N3 | T5 | N4 So N4 asking about T2 could get T1 or T3 and/or T4 or T5, depending on execution timing. N1 T1 T2 N2 N3 T3 T4 T5 T6 N4 N5 T7 T8 N6 So N6 asking about T7 could one or more of (T2, T5, T6, T8) depending on timing This is only important to nodes with more than one input - any 'join' functionality.

Parameters:
tokenID -
Returns:
misry and pain


Copyright © 2004-2005 The Apache Software Foundation. All Rights Reserved.