org.smartcomps.twister.engine.priv.core.definition
Class ActivityFactory

java.lang.Object
  |
  +--org.smartcomps.twister.engine.priv.core.definition.ActivityFactory

public class ActivityFactory
extends java.lang.Object

Creates appropriate activities or activity specific objects, setting default values.


Constructor Summary
ActivityFactory()
           
 
Method Summary
static org.smartcomps.twister.engine.priv.core.definition.AlarmEvent addAlarmEvent(org.smartcomps.twister.engine.priv.core.definition.Pick pick, org.smartcomps.twister.engine.priv.core.definition.Activity activity, java.lang.String timeExpression, int type)
          Adds an AlarmEvent to a Pick structured activity triggering the execution of the provided activity when the corresponding alarm is reached.
static org.smartcomps.twister.engine.priv.core.definition.Assignment addAssignment(org.smartcomps.twister.engine.priv.core.definition.Assign assign, int fromType, int toType)
          Adds an assignment to an assign activity, creating the associated Assign persistent instance.
static org.smartcomps.twister.engine.priv.core.definition.CorrelationRef addCorrelationRef(org.smartcomps.twister.engine.priv.core.definition.Invoke invoke, java.lang.String set, boolean initiate, int pattern)
          Adds a correlation reference (CorrelationRef) to an Invoke activity.
static org.smartcomps.twister.engine.priv.core.definition.CorrelationRef addCorrelationRef(org.smartcomps.twister.engine.priv.core.definition.Receive receive, java.lang.String set, boolean initiate, int pattern)
          Adds a correlation reference (CorrelationRef) to a Receive activity.
static org.smartcomps.twister.engine.priv.core.definition.MessageEvent addMessageEvent(org.smartcomps.twister.engine.priv.core.definition.Pick pick, org.smartcomps.twister.engine.priv.core.definition.Activity activity, java.lang.String partnerLink, java.lang.String portType, java.lang.String operation, java.lang.String variable, java.util.Set correlations)
          Adds a MessageEvent to a Pick structured activity triggering the execution of the provided activity when an appropriate message is received.
static void bindDestination(java.lang.String linkName, org.smartcomps.twister.engine.priv.core.definition.Activity sourceActivity)
          TODO Implement me with Flow Binds an activity as the destination of a Link, eventually creating that Link if it doesn't exist.
static void bindSource(java.lang.String linkName, org.smartcomps.twister.engine.priv.core.definition.Activity sourceActivity)
          TODO Implement me with Flow Binds an activity as the source of a Link, eventually creating that Link if it doesn't exist.
static org.smartcomps.twister.engine.priv.core.definition.Activity createActivity(java.lang.Class activityInterface, org.smartcomps.twister.engine.priv.core.definition.StructuredActivity container)
          Creates a new persistent activity instance implementing the provided interface and assigns it to the provided container.
static org.smartcomps.twister.engine.priv.core.definition.Activity createActivity(java.lang.Class activityInterface, org.smartcomps.twister.engine.priv.core.definition.TwisterProcess process)
          Creates a new persistent activity instance implementing the provided interface and assigns it to the provided process, only needed once in a process creation.
static org.smartcomps.twister.engine.priv.core.definition.AlarmEvent createAlarmEvent(java.lang.String timeExpression, int type)
          Deprecated. use addAlarmEvent on Pick instead
static org.smartcomps.twister.engine.priv.core.definition.CorrelationRef createCorrelationRef(java.lang.String set, boolean initiate, int pattern)
           
static org.smartcomps.twister.engine.priv.core.definition.MessageEvent createMessageEvent(java.lang.String partnerLink, java.lang.String portType, java.lang.String operation, java.lang.String variable, java.util.Set correlations)
          Deprecated. use addMessageEvent on Pick instead
static java.util.List findPickEventsByInvoker(java.lang.String partnerLink, java.lang.String portType, java.lang.String operation)
          Finds Picks and according MessageEvents interested in the provided invoker paramters.
static java.util.List findReceivesByInvoker(java.lang.String partnerLink, java.lang.String portType, java.lang.String operation)
          Find receives interested in the provided invoker paramaters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityFactory

public ActivityFactory()
Method Detail

addAssignment

public static org.smartcomps.twister.engine.priv.core.definition.Assignment addAssignment(org.smartcomps.twister.engine.priv.core.definition.Assign assign,
                                                                                          int fromType,
                                                                                          int toType)
                                                                                   throws DBSessionException
Adds an assignment to an assign activity, creating the associated Assign persistent instance.

Parameters:
assign - the Assign activity to add assignment for
fromType - the type of the "from" part of the assignment (see Assignment interface)
toType - the type of the "to" part of the assignment (see Assignment interface)
Returns:
the newly create Assignment instance (usually not useful)
Throws:
DBSessionException
DBSessionException
See Also:
Assignment

addCorrelationRef

public static org.smartcomps.twister.engine.priv.core.definition.CorrelationRef addCorrelationRef(org.smartcomps.twister.engine.priv.core.definition.Invoke invoke,
                                                                                                  java.lang.String set,
                                                                                                  boolean initiate,
                                                                                                  int pattern)
                                                                                           throws DBSessionException
Adds a correlation reference (CorrelationRef) to an Invoke activity.

Parameters:
invoke -
set -
initiate -
pattern -
Returns:
Throws:
DBSessionException

addCorrelationRef

public static org.smartcomps.twister.engine.priv.core.definition.CorrelationRef addCorrelationRef(org.smartcomps.twister.engine.priv.core.definition.Receive receive,
                                                                                                  java.lang.String set,
                                                                                                  boolean initiate,
                                                                                                  int pattern)
                                                                                           throws DBSessionException
Adds a correlation reference (CorrelationRef) to a Receive activity.

Parameters:
receive -
set -
initiate -
pattern -
Returns:
Throws:
DBSessionException

addMessageEvent

public static org.smartcomps.twister.engine.priv.core.definition.MessageEvent addMessageEvent(org.smartcomps.twister.engine.priv.core.definition.Pick pick,
                                                                                              org.smartcomps.twister.engine.priv.core.definition.Activity activity,
                                                                                              java.lang.String partnerLink,
                                                                                              java.lang.String portType,
                                                                                              java.lang.String operation,
                                                                                              java.lang.String variable,
                                                                                              java.util.Set correlations)
                                                                                       throws DBSessionException
Adds a MessageEvent to a Pick structured activity triggering the execution of the provided activity when an appropriate message is received.

Parameters:
pick -
activity -
partnerLink -
portType -
operation -
variable -
correlations -
Returns:
Throws:
DBSessionException

addAlarmEvent

public static org.smartcomps.twister.engine.priv.core.definition.AlarmEvent addAlarmEvent(org.smartcomps.twister.engine.priv.core.definition.Pick pick,
                                                                                          org.smartcomps.twister.engine.priv.core.definition.Activity activity,
                                                                                          java.lang.String timeExpression,
                                                                                          int type)
                                                                                   throws DBSessionException
Adds an AlarmEvent to a Pick structured activity triggering the execution of the provided activity when the corresponding alarm is reached.

Parameters:
pick -
activity -
timeExpression -
type -
Returns:
Throws:
DBSessionException

createActivity

public static org.smartcomps.twister.engine.priv.core.definition.Activity createActivity(java.lang.Class activityInterface,
                                                                                         org.smartcomps.twister.engine.priv.core.definition.StructuredActivity container)
                                                                                  throws DBSessionException
Creates a new persistent activity instance implementing the provided interface and assigns it to the provided container.
IMPORTANT : when you create a container and then create several activities using this container, the order used to create activities is the order of addition in the container. For example when you create a Sequence, the order in which you create sub-activities will be the order of activities in the sequence.

Parameters:
activityInterface - the interface the returned instance has to implement
container - the container to register the created activity under
Returns:
a persistent implementation of the provided interface
DBSessionException

createActivity

public static org.smartcomps.twister.engine.priv.core.definition.Activity createActivity(java.lang.Class activityInterface,
                                                                                         org.smartcomps.twister.engine.priv.core.definition.TwisterProcess process)
                                                                                  throws DBSessionException
Creates a new persistent activity instance implementing the provided interface and assigns it to the provided process, only needed once in a process creation.
IMPORTANT : when you create a container and then create several activities using this container, the order used to create activities is the order of addition in the container. For example when you create a Sequence, the order in which you create sub-activities will be the order of activities in the sequence.

Parameters:
activityInterface - the interface the returned instance has to implement
process - the process to register the created activity under
Returns:
a persistent implementation of the provided interface
DBSessionException

createMessageEvent

public static org.smartcomps.twister.engine.priv.core.definition.MessageEvent createMessageEvent(java.lang.String partnerLink,
                                                                                                 java.lang.String portType,
                                                                                                 java.lang.String operation,
                                                                                                 java.lang.String variable,
                                                                                                 java.util.Set correlations)
                                                                                          throws DBSessionException
Deprecated. use addMessageEvent on Pick instead

Creates a MessageEvent persistent implementation initializing it with the provided values.

Parameters:
partnerLink -
portType -
operation -
variable -
correlations -
Returns:
a MessageEvent persistent implementation
Throws:
DBSessionException
DBSessionException

createAlarmEvent

public static org.smartcomps.twister.engine.priv.core.definition.AlarmEvent createAlarmEvent(java.lang.String timeExpression,
                                                                                             int type)
                                                                                      throws DBSessionException,
                                                                                             DBSessionException
Deprecated. use addAlarmEvent on Pick instead

Creates an AlarmEvent persistent implementation initializing it with the provided values.

Parameters:
timeExpression -
type -
Returns:
an AlarmEvent persistent implementation
Throws:
DBSessionException
DBSessionException

createCorrelationRef

public static org.smartcomps.twister.engine.priv.core.definition.CorrelationRef createCorrelationRef(java.lang.String set,
                                                                                                     boolean initiate,
                                                                                                     int pattern)
                                                                                              throws DBSessionException
DBSessionException

bindSource

public static void bindSource(java.lang.String linkName,
                              org.smartcomps.twister.engine.priv.core.definition.Activity sourceActivity)
                       throws LinkAlreadyBoundException
TODO Implement me with Flow Binds an activity as the source of a Link, eventually creating that Link if it doesn't exist.

Parameters:
linkName -
sourceActivity -
LinkAlreadyBoundException

bindDestination

public static void bindDestination(java.lang.String linkName,
                                   org.smartcomps.twister.engine.priv.core.definition.Activity sourceActivity)
                            throws LinkAlreadyBoundException
TODO Implement me with Flow Binds an activity as the destination of a Link, eventually creating that Link if it doesn't exist.

Parameters:
linkName -
sourceActivity -
LinkAlreadyBoundException

findReceivesByInvoker

public static java.util.List findReceivesByInvoker(java.lang.String partnerLink,
                                                   java.lang.String portType,
                                                   java.lang.String operation)
                                            throws DBSessionException
Find receives interested in the provided invoker paramaters.

Parameters:
partnerLink -
portType -
operation -
Returns:
List of Receive
Throws:
DBSessionException

findPickEventsByInvoker

public static java.util.List findPickEventsByInvoker(java.lang.String partnerLink,
                                                     java.lang.String portType,
                                                     java.lang.String operation)
                                              throws DBSessionException
Finds Picks and according MessageEvents interested in the provided invoker paramters.

Parameters:
partnerLink -
portType -
operation -
Returns:
List of Object[] containing the Pick as obj[0] and the MessageEvent as obj[1]
Throws:
DBSessionException


Copyright © 2003 SmartComps. All Rights Reserved.