Class Transition
This partial class allows to read transitions in the previous formatting
Inherited Members
Namespace: Xareus.Scenarios
Assembly: Xareus.Scenarios.dll
Syntax
[Serializable]
public class Transition : Identifiable
Constructors
Transition()
Declaration
public Transition()
Transition(string, string)
Constructor
Declaration
public Transition(string id, string label = "")
Parameters
Fields
bypassTriggerable
Must the transition bypass the Sensor check
Declaration
protected bool bypassTriggerable
Field Value
Type | Description |
---|---|
bool |
downstreamSequenceList
The list of downstream sequences of this transition
Declaration
protected List<ASequence> downstreamSequenceList
Field Value
externalContext
The external context
Declaration
protected IContext externalContext
Field Value
Type | Description |
---|---|
IContext |
lastSensorResult
Declaration
protected ASensor.Result lastSensorResult
Field Value
scenarioContext
The scenario context
Declaration
protected IContext scenarioContext
Field Value
Type | Description |
---|---|
IContext |
sensorChecking
Is the transition's sensor currently checking
Declaration
protected bool sensorChecking
Field Value
Type | Description |
---|---|
bool |
sequenceContextWhenConsumed
Declaration
protected IContext sequenceContextWhenConsumed
Field Value
Type | Description |
---|---|
IContext |
tokenAssignFunction
The instantiated token assign object
Declaration
protected ATokenAssign tokenAssignFunction
Field Value
Type | Description |
---|---|
AToken |
tokenMergeFunction
The instantiated token merge object
Declaration
protected ATokenMerge tokenMergeFunction
Field Value
Type | Description |
---|---|
AToken |
upstreamSequenceList
The list of upstream sequences of this transition
Declaration
protected List<ASequence> upstreamSequenceList
Field Value
Properties
DownstreamSequences
The list of downstream sequences of this transition
Declaration
public List<ASequence> DownstreamSequences { get; }
Property Value
Enabled
Checks whether the transition is enabled (i.e. its upstream places all have a token).
Declaration
public virtual bool Enabled { get; }
Property Value
Type | Description |
---|---|
bool |
Firing
Checks whether transition is currently firing
Declaration
public bool Firing { get; }
Property Value
Type | Description |
---|---|
bool |
Id
Transition Id
Declaration
public string Id { get; set; }
Property Value
Type | Description |
---|---|
string |
Priority
Get the calculated priority of the transition. The transition must be enabled to get a value using the sequence context (i.e. token)
Declaration
public int Priority { get; set; }
Property Value
Type | Description |
---|---|
int | return 0 if no priority is specified, the parsed value otherwise |
Triggered
Checks whether the sensors attached to this transition is triggered (i.e. its SensorCheck returns True).
Declaration
public virtual bool Triggered { get; }
Property Value
Type | Description |
---|---|
bool |
UpstreamSequences
The list of upstream sequences of this transition
Declaration
public List<ASequence> UpstreamSequences { get; }
Property Value
WillBypass
Checks whether the sensor attached to this transition will bypass
Declaration
public bool WillBypass { get; }
Property Value
Type | Description |
---|---|
bool |
WillTrigger
Checks whether the sensors attached to this transition will trigger
Declaration
public virtual bool WillTrigger { get; }
Property Value
Type | Description |
---|---|
bool |
downstreamPlace
Declaration
public List<Reference> downstreamPlace { get; set; }
Property Value
downstreamSequence
Declaration
public virtual List<Reference> downstreamSequence { get; set; }
Property Value
event
Declaration
public virtual Event @event { get; set; }
Property Value
Type | Description |
---|---|
Event |
label
Transition Label
Declaration
public override string label { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
priority
Declaration
public virtual string priority { get; set; }
Property Value
Type | Description |
---|---|
string |
tokenAssign
Declaration
public virtual Function tokenAssign { get; set; }
Property Value
Type | Description |
---|---|
Function |
tokenMerge
Declaration
public virtual Function tokenMerge { get; set; }
Property Value
Type | Description |
---|---|
Function |
upstreamPlace
Declaration
public List<Reference> upstreamPlace { get; set; }
Property Value
upstreamSequence
Declaration
public virtual List<Reference> upstreamSequence { get; set; }
Property Value
Methods
AddDownstreamSequence(ASequence)
Adds the given sequence in the downstream list of the transition
Declaration
public virtual void AddDownstreamSequence(ASequence sequence)
Parameters
Type | Name | Description |
---|---|---|
ASequence | sequence |
AddUpstreamSequence(ASequence)
Adds the given sequence in the upstream list of the transition
Declaration
public virtual void AddUpstreamSequence(ASequence sequence)
Parameters
Type | Name | Description |
---|---|---|
ASequence | sequence |
AssignTokens(IContext, IContext, List<ASequence>)
Declaration
protected virtual void AssignTokens(IContext sequenceContext, IContext eventContext, List<ASequence> downstreamSequenceList)
Parameters
Type | Name | Description |
---|---|---|
IContext | sequenceContext | |
IContext | eventContext | |
List<ASequence> | downstreamSequenceList |
CancelFireAsSoonAsPossible()
Cancel forcing the transition to fire
Declaration
public void CancelFireAsSoonAsPossible()
FireAsSoonAsPossible(object)
Force the transition to fire with the given context as event context
Declaration
[Obsolete("Use FireAsSoonAsPossible(IContext) instead")]
public void FireAsSoonAsPossible(object eventContextOverride)
Parameters
Type | Name | Description |
---|---|---|
object | eventContextOverride |
FireAsSoonAsPossible(IContext)
Force the transition to fire with the given context as event context
Declaration
public void FireAsSoonAsPossible(IContext eventContextOverride)
Parameters
Type | Name | Description |
---|---|---|
IContext | eventContextOverride |
FireNow(IContext)
Force the transition to fire now with the given context as event context
Declaration
public virtual bool FireNow(IContext eventContextOverride)
Parameters
Type | Name | Description |
---|---|---|
IContext | eventContextOverride |
Returns
Type | Description |
---|---|
bool | true if the transition could be fired (That does not mean its finished firing) |
GetActivableSensor()
Gets the first sensor (a.k.a. sensor check function) of the event of the transition.
Declaration
public ASensor GetActivableSensor()
Returns
Type | Description |
---|---|
ASensor |
GetActivableSensors()
Gets the sensors (a.k.a. sensor check functions) of the event of the transition.
Declaration
public IEnumerable<ASensor> GetActivableSensors()
Returns
Type | Description |
---|---|
IEnumerable<ASensor> |
GetAllFunctions()
Get all the functions used in this transition
Declaration
public IEnumerable<Function> GetAllFunctions()
Returns
Type | Description |
---|---|
IEnumerable<Function> | The functions used in the transition |
GetAllInstantiatedFunctions()
Get all the instantiated functions used in this transition
Declaration
public IEnumerable<AFunction> GetAllInstantiatedFunctions()
Returns
Type | Description |
---|---|
IEnumerable<AFunction> | The instantiated functions used in the transition |
GetCheckResult()
Declaration
public ASensor.Result GetCheckResult()
Returns
InvokeTransitionFiredEvent()
Declaration
protected void InvokeTransitionFiredEvent()
MergeTokens()
Declaration
protected virtual IContext MergeTokens()
Returns
Type | Description |
---|---|
IContext |
RemoveAllDownstreamSequences()
Removes all downstream sequences
Declaration
public virtual void RemoveAllDownstreamSequences()
RemoveAllUpstreamSequences()
Removes all upstream sequences
Declaration
public virtual void RemoveAllUpstreamSequences()
RemoveDownstreamSequence(ASequence)
Removes the given sequence from the downstream list of the transition
Declaration
public virtual void RemoveDownstreamSequence(ASequence sequence)
Parameters
Type | Name | Description |
---|---|---|
ASequence | sequence |
RemoveUpstreamSequence(ASequence)
Removes the given sequence from the upstream list of the transition
Declaration
public void RemoveUpstreamSequence(ASequence sequence)
Parameters
Type | Name | Description |
---|---|---|
ASequence | sequence |
RenameDownstreamSequence(string, string)
Rename the downstream sequence
Declaration
public virtual void RenameDownstreamSequence(string previousId, string newId)
Parameters
RenameUpstreamSequence(string, string)
Rename the upstream sequence
Declaration
public virtual void RenameUpstreamSequence(string previousId, string newId)
Parameters
SetTokenAssign()
Declaration
protected virtual void SetTokenAssign()
SetTokenAssign(ATokenAssign)
Set the token assign function to use from an existing instance
Declaration
public void SetTokenAssign(ATokenAssign value)
Parameters
Type | Name | Description |
---|---|---|
AToken |
value |
SetTokenMerge()
Declaration
protected virtual void SetTokenMerge()
SetTokenMerge(ATokenMerge)
Set the token merge function to use from an existing instance
Declaration
public void SetTokenMerge(ATokenMerge value)
Parameters
Type | Name | Description |
---|---|---|
AToken |
value |
StartSensorCheck()
Start the sensor
Declaration
public void StartSensorCheck()
StopSensorCheck()
Stop the sensor
Declaration
public void StopSensorCheck()
Events
TransitionFiredEvent
Declaration
public event EventHandler<TransitionFiredEventArgs> TransitionFiredEvent
Event Type
Type | Description |
---|---|
Event |