org.smartcomps.twister.engine.priv.core.definition
Interface Pick

All Superinterfaces:
Activity, StructuredActivity
All Known Implementing Classes:
PickImpl

public interface Pick
extends StructuredActivity

A pick is a structured activity that allows you to block and wait for a suitable message to arrive or for a time-out alarm to go off. When one of these triggers occurs, the associated activity is performed and the pick completes.
Each Pick activty must include at least one MessageEvent.

See Also:

Method Summary
 void addAlarmEvent(org.smartcomps.twister.engine.priv.core.definition.AlarmEvent event, org.smartcomps.twister.engine.priv.core.definition.Activity activity)
          Adds an alarm event to this Pick activity that triggers the provided activity when fired.
 void addMessageEvent(org.smartcomps.twister.engine.priv.core.definition.MessageEvent event, org.smartcomps.twister.engine.priv.core.definition.Activity activity)
          Adds a message event to this Pick activity that triggers the provided activity when fired.
 org.smartcomps.twister.engine.priv.core.dynamic.ExecutionContext execute(java.lang.String correlationSetName, java.util.Map correlation)
          Pick is one of the rare structured activity that can be directly executed.
 java.util.Map getActivityAlarmEvents()
          Builds a Map containing activities as keys and corresponding alarm events as values.
 java.util.Map getActivityMessageEvents()
          Builds a Map containing activities as keys and corresponding message events as values.
 org.smartcomps.twister.engine.priv.core.definition.AlarmEvent getAlarmEvent(org.smartcomps.twister.engine.priv.core.definition.Activity activity)
          Returns the alarm event associated with the provided activity.
 org.smartcomps.twister.engine.priv.core.definition.MessageEvent getMessageEvent(org.smartcomps.twister.engine.priv.core.definition.Activity activity)
          Returns the message event associated with the provided activity.
 java.util.List getMessageEvents()
          Returns the list of MessageEvent in the Pick structured activity.
 boolean isCreateInstance()
           
 void setCreateInstance(boolean createInstance)
           
 
Methods inherited from interface org.smartcomps.twister.engine.priv.core.definition.StructuredActivity
addActivity, addExecutionContext, getActivities, getExecutionContexts
 
Methods inherited from interface org.smartcomps.twister.engine.priv.core.definition.Activity
fetchProcess, getContainer, getJoinCondition, getName, getProcess, getSourceLinks, getTargetLinks, setJoinCondition, setName, setSourceLinks, setTargetLinks
 

Method Detail

isCreateInstance

public boolean isCreateInstance()

setCreateInstance

public void setCreateInstance(boolean createInstance)

addMessageEvent

public void addMessageEvent(org.smartcomps.twister.engine.priv.core.definition.MessageEvent event,
                            org.smartcomps.twister.engine.priv.core.definition.Activity activity)
Adds a message event to this Pick activity that triggers the provided activity when fired. Message events must be added in the same order as activities have been created and registered in this container and before any alarm event.

Parameters:
event - the message event to wait for to fire the activity
activity - to start when the message event occurs

getActivityMessageEvents

public java.util.Map getActivityMessageEvents()
Builds a Map containing activities as keys and corresponding message events as values.

Returns:
Map of activity / message event pairs

getMessageEvent

public org.smartcomps.twister.engine.priv.core.definition.MessageEvent getMessageEvent(org.smartcomps.twister.engine.priv.core.definition.Activity activity)
Returns the message event associated with the provided activity.

Parameters:
activity - associated with the wanted message event
Returns:
MessageEvent

getMessageEvents

public java.util.List getMessageEvents()
Returns the list of MessageEvent in the Pick structured activity. The MessageEvent objects in this list have the same positions as their corresponding activity in the Pick container.

Returns:

addAlarmEvent

public void addAlarmEvent(org.smartcomps.twister.engine.priv.core.definition.AlarmEvent event,
                          org.smartcomps.twister.engine.priv.core.definition.Activity activity)
Adds an alarm event to this Pick activity that triggers the provided activity when fired. Alarm events must be added in the same order as activities have been created and registered in this container and after any message event.

Parameters:
event - the alarm event to wait for to fire the activity
activity - to start when the message event occurs

getActivityAlarmEvents

public java.util.Map getActivityAlarmEvents()
Builds a Map containing activities as keys and corresponding alarm events as values.

Returns:
Map of activity / alarm event pairs

getAlarmEvent

public org.smartcomps.twister.engine.priv.core.definition.AlarmEvent getAlarmEvent(org.smartcomps.twister.engine.priv.core.definition.Activity activity)
Returns the alarm event associated with the provided activity.

Parameters:
activity - associated with the wanted alarm event
Returns:
AlarmEvent

execute

public org.smartcomps.twister.engine.priv.core.dynamic.ExecutionContext execute(java.lang.String correlationSetName,
                                                                                java.util.Map correlation)
                                                                         throws EngineException
Pick is one of the rare structured activity that can be directly executed. Actually it's only one of its activity that will be executed but this execution is done in the scope of the Pick.

Parameters:
correlationSetName -
correlation -
Returns:
Throws:
EngineException


Copyright © 2003 SmartComps. All Rights Reserved.