Class Transition
This partial class allows to read transitions in the previous formatting
Assembly: Xareus.Scenarios.dll
Syntax
[Serializable]
public class Transition : Identifiable
Constructors
Transition()
Declaration
Transition(string, string)
Declaration
public Transition(string id, string label = "")
Parameters
Type |
Name |
Description |
string |
id |
The Id must be unique
|
string |
label |
The label (optional)
|
Fields
bypassTriggerable
Must the transition bypass the Sensor check
Declaration
protected bool bypassTriggerable
Field Value
downstreamSequenceList
The list of downstream sequences of this transition
Declaration
protected List<ASequence> downstreamSequenceList
Field Value
externalContext
Declaration
protected IContext externalContext
Field Value
lastSensorResult
Declaration
protected ASensor.Result lastSensorResult
Field Value
scenarioContext
Declaration
protected IContext scenarioContext
Field Value
sensorChecking
Is the transition's sensor currently checking
Declaration
protected bool sensorChecking
Field Value
sequenceContextWhenConsumed
Declaration
protected IContext sequenceContextWhenConsumed
Field Value
tokenAssignFunction
The instantiated token assign object
Declaration
protected ATokenAssign tokenAssignFunction
Field Value
tokenMergeFunction
The instantiated token merge object
Declaration
protected ATokenMerge tokenMergeFunction
Field Value
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
Firing
Checks whether transition is currently firing
Declaration
public bool Firing { get; }
Property Value
Id
Declaration
public string Id { get; set; }
Property Value
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
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
WillTrigger
Checks whether the sensors attached to this transition will trigger
Declaration
public virtual bool WillTrigger { get; }
Property Value
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
label
Declaration
public override string label { get; set; }
Property Value
Overrides
priority
Declaration
public virtual string priority { get; set; }
Property Value
tokenAssign
Declaration
public virtual Function tokenAssign { get; set; }
Property Value
tokenMerge
Declaration
public virtual Function tokenMerge { get; set; }
Property Value
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
AddUpstreamSequence(ASequence)
Adds the given sequence in the upstream list of the transition
Declaration
public virtual void AddUpstreamSequence(ASequence sequence)
Parameters
AssignTokens(IContext, IContext, List<ASequence>)
Declaration
protected virtual void AssignTokens(IContext sequenceContext, IContext eventContext, List<ASequence> downstreamSequenceList)
Parameters
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
GetActivableSensors()
Gets the sensors (a.k.a. sensor check functions) of the event of the transition.
Declaration
public IEnumerable<ASensor> GetActivableSensors()
Returns
GetAllFunctions()
Get all the functions used in this transition
Declaration
public IEnumerable<Function> GetAllFunctions()
Returns
GetAllInstantiatedFunctions()
Get all the instantiated functions used in this transition
Declaration
public IEnumerable<AFunction> GetAllInstantiatedFunctions()
Returns
GetCheckResult()
Declaration
public ASensor.Result GetCheckResult()
Returns
InvokeTransitionFiredEvent()
Declaration
protected void InvokeTransitionFiredEvent()
MergeTokens()
Declaration
protected virtual IContext MergeTokens()
Returns
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
RemoveUpstreamSequence(ASequence)
Removes the given sequence from the upstream list of the transition
Declaration
public void RemoveUpstreamSequence(ASequence sequence)
Parameters
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
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
StartSensorCheck()
Declaration
public void StartSensorCheck()
StopSensorCheck()
Declaration
public void StopSensorCheck()
Events
TransitionFiredEvent
Declaration
public event EventHandler<TransitionFiredEventArgs> TransitionFiredEvent
Event Type
Extension Methods