INSA
  • Tutorials
  • Documentation
  • Api Documentation
  • Changelog
Show / Hide Table of Contents
  • Relations
    • Xareus.Relations
      • IEngine
      • IObject
      • IObjectType
      • IRelation
      • Object
      • ObjectMatch
      • ObjectPattern
      • ObjectQueryParameters
      • ObjectType
      • PatternType
      • Realization
      • RealizationQueryParameters
      • Reference
      • Relation
      • Type
      • TypeMatch
      • TypeSearch
    • Xareus.Relations.CSharp
      • Engine
    • Xareus.Relations.Extra
      • Helper
      • IRunnableRelation
      • ObjectPatternAttribute
    • Xareus.Relations.Tests
      • Bolt
      • Inheritance
      • RelationsTests
      • S3PM
    • Xareus.Relations.Tests.CSharp
      • EngineTest
    • Xareus.Relations.Utilities
      • Extensions
  • Scenarios
    • Xareus.Scenarios
      • AFunction
      • ASequence
      • Assignment
      • ComplexSequence
      • Decision
      • DecisionEvent
      • DecisionTree
      • Decoration
      • Event
      • Event.EffectorData
      • Event.SensorData
      • Extendable
      • ExtendedInfo
      • ExternalScenario
      • Function
      • IValueParser
      • Identifiable
      • InitialSequence
      • Net
      • Node
      • NodeUserData
      • Parameter
      • Place
      • ProxySequence
      • Reference
      • SMTransition
      • SafePetriNet
      • Scenario
      • ScenarioLoadedEventArgs
      • ScenarioLoadingParameters
      • ScenarioState
      • SequenceState
      • SetValueInContextEffector
      • SimpleSequence
      • State
      • StateMachine
      • Transition
      • TransitionFiredEventArgs
      • TypedValue
      • ValueParser
    • Xareus.Scenarios.Arithmetics
      • NumberBetweenSensor
      • NumberEffector
      • NumberEffector.ArithmeticalOperator
      • NumberSensor
      • NumberSensor.ComparisonOperator
      • RandomNumberEffector
      • Utils
    • Xareus.Scenarios.AssignmentEval
      • AAssignmentEval
    • Xareus.Scenarios.Boolean
      • BooleanEffector
      • BooleanEffector.LogicalOperator
      • BooleanSensor
      • BooleanSensor.ComparisonOperator
    • Xareus.Scenarios.Context
      • BackwardCompatibilityContext
      • BackwardCompatibilityContext.ParserDelegate
      • ContextType
      • IContext
      • Map
      • SimpleDictionary
      • Trie
    • Xareus.Scenarios.ContextInit
      • AContextInit
      • DefaultContextInit
    • Xareus.Scenarios.Converter
      • BoolConverter
      • ByteConverter
      • CharConverter
      • DoubleConverter
      • FloatConverter
      • IntConverter
      • LongConverter
      • PlaceConverter
      • PrimitiveConverter
      • SByteConverter
      • SMTransitionConverter
      • SafePetriNetConverter
      • ScenarioStateConverter
      • ScenarioVariablePathConverter
      • SequenceStateConverter
      • ShortConverter
      • StateConverter
      • StateMachineConverter
      • TransitionConverter
      • UIntConverter
      • ULongConverter
      • UShortConverter
      • VariableConverter
      • VariablePathConverter
    • Xareus.Scenarios.Converters
      • ArrayConverter
      • CollectionConverter
      • StringConverter
      • TypeConverter
    • Xareus.Scenarios.Effector
      • AEffector
    • Xareus.Scenarios.Exception
      • InvalidDataException
      • InvalidStateException
    • Xareus.Scenarios.Extra
      • AssignmentOverlap
      • DefaultTokenUpdate
      • DefaultTokenUpdate.TokenData
      • DownstreamSequenceList
      • EventSensor
      • ExtendedInfoHelper
      • SelectFromListEffector
      • SequenceList
      • TransitionFiredSensor
      • UpstreamSequenceList
      • VariableExistsSensor
    • Xareus.Scenarios.Extra.Time
      • WaitEffector
    • Xareus.Scenarios.FinalTokenMerge
      • AFinalTokenMerge
      • CopyAllTokens
      • PickFirst
    • Xareus.Scenarios.Network
      • AScenarioSender
      • INetSocketTcp
      • NetSocketTcpScenarioReceiver
      • NetSocketTcpScenarioSender
      • NetSocketTcpScenarioSender.ClientNewScenarioRegistration
      • NetSocketTcpScenarioSender.ClientUpdateRegistration
      • NetSocketTcpUtils
      • NetSocketTcpUtils.ReceiveState
    • Xareus.Scenarios.Network.Tests
      • NetworkTest
    • Xareus.Scenarios.ScenarioManipulation
      • AddTokenToSequencesEffector
      • AddTokenToSequencesEffector.TokenData
      • LoadScenarioStateEffector
      • LoadScenarioStateFromFileEffector
      • LoadSequenceStateEffector
      • LoadSequenceStateFromFileEffector
      • RemoveTokensFromSequencesEffector
      • SaveScenarioStateEffector
      • SaveScenarioStateInFileEffector
      • SaveSequenceStateEffector
      • SaveSequenceStateInFileEffector
    • Xareus.Scenarios.Sensor
      • ASensor
      • ASensor.Result
    • Xareus.Scenarios.Tests
      • ConfigurationParameterTest
      • ConvertersTests
      • IContextTest
      • ParserTest
      • ProgramTest
      • ScenarioManipulationTests
      • ScenarioTest
      • TypeTest
      • TypeTest.OverrideClass
    • Xareus.Scenarios.Time
      • RandomTimeSensor
      • TimeParametersConverter
      • TimeSensor
      • TimeUnit
      • TimeUtils
    • Xareus.Scenarios.TokenAssign
      • ATokenAssign
      • DoNothing
    • Xareus.Scenarios.TokenInit
      • ATokenInit
      • DefaultTokenInit
      • EmptyTokenInit
    • Xareus.Scenarios.TokenMerge
      • ATokenMerge
      • CopyAllTokens
      • PickFirst
    • Xareus.Scenarios.TokenSplit
      • ATokenSplit
    • Xareus.Scenarios.Utilities
      • BackwardCompatibilityManager
      • ConfigurationParameterAttribute
      • ContextVariableAttribute
      • EventContextEntryAttribute
      • FunctionDescriptionAttribute
      • FunctionManager
      • IFunctionParametersConverter
      • IRenameClass
      • IRenamedProvider
      • Necessity
      • ObsoleteUtils
      • OverrideClassAttribute
      • ParameterChecker
      • RenamedAttribute
      • RenamedManagerBase
      • RenamedTypeUtils
      • RuntimeTools
      • TypeConverterForAttribute
    • Xareus.Scenarios.Variables
      • ContextVariable<T>
      • EventVariablePath
      • ExternalContextVariablePath
      • ScenarioVariablePath
      • TokenVariablePath
      • Variable
      • VariablePath
  • Scenarios.Relations
      • Program
    • Xareus.Scenarios.Relations
      • Action
      • ActionLogEffector
      • ActionRecordEffector
      • ActionRecorder
      • AnyRelationSensor
      • Change
      • Environment
      • Execution
      • IRealizationManager
      • InitializeRecorderEffector
      • RealizationContext
      • RealizationManager
      • RealizationRecord
      • RelationEffector
      • RelationSensor
      • RelationsValueParser
      • RenamedProvider
      • WriteActionRecordEffector
    • Xareus.Scenarios.Relations.TypeConverter
      • FiveObjectConverter
      • RealizationConverter
      • RelationConverter
  • Utils
    • Xareus.Utils
      • AssemblyUtils
      • DatedEventManager<DataType, TimeType>
      • DatedEventManager<DataType, TimeType>.EventRecord
      • Extensions
      • FieldsAndPropertiesContainer
      • MemberUtils
      • Serialization
      • TypeUtils
      • UriUtils
    • Xareus.Utils.Tests
      • DatedEventManagerTest
      • DatedEventManagerTest.TestDatedEventManager
      • ExtensionsTests
      • MemberUtilsTest
      • TypeUtilsTests
      • TypeUtilsTests.DummySensor
      • TypeUtilsTests.GenericClassUser
      • TypeUtilsTests.GenericClass<T>
      • UriUtilsTest
  • Unity
    • FIVE.Unity
      • UFManager
      • UFRelationEngine
      • UFScenarioEngineKernel
    • Xareus.Unity
      • GameObjectExtension
      • Log4netFileAppender
      • Log4netUnityAppender
      • XULog4net
      • XareusManager
    • Xareus.Unity.Converters
      • ColorConverter
      • MemberInfoConverter
      • MethodInfoConverter
      • QuaternionConverter
      • UnityObjectConverter
      • Vector2Converter
      • Vector2IntConverter
      • Vector3Converter
      • Vector3IntConverter
      • Vector4Converter
      • VectorConverter
    • Xareus.Unity.TypeDescriptorContext
      • DictionaryDescriptorContext
      • SimpleTypeDescriptorContext<T>
      • UnityObjectDescriptorContext
  • Unity Relations
    • Xareus.Relations.Scenarios.Unity
      • TypeWithScenario
    • Xareus.Relations.Unity
      • BaseEditorDescriptorAttribute
      • GenerationMode
      • IRelationEngine
      • IdentifiableBehaviour
      • ObjectPatternAttribute
      • ObjectPatternDescriptorAttribute
      • ObjectQueryWithCallback
      • ParameterDescriptorAttribute
      • RealizationQueryWithCallback
      • RelationDescriptorAttribute
      • RelationEngine
      • RelationEngineKernel
      • RelationParameters
      • Serializer
      • TypeDescriptorAttribute
      • TypeMember
      • TypeParentAttribute
      • UniqueIDGenerator
      • XUObject
      • XUObject.XuObjectChanged
      • XUObjectPattern
      • XUObjectQueryParameters
      • XURealization
      • XURealizationQueryParameters
      • XURelation
      • XUType
      • XUTypeSearch
    • Xareus.Relations.Unity.Converters
      • XUObjectConverter
      • XURelationTypeConverter
      • XUTypeConverter
  • Unity Scenarios
      • ABaseScenarioElementUI
      • DecisionTreeUI
    • Xareus.Scenarios.Network.Unity
      • NetworkClient
      • NetworkManager
      • NetworkServer
      • UnityNetSocketTcpScenarioReceiver
      • UnityNetSocketTcpScenarioSender
    • Xareus.Scenarios.Unity
      • AInUnityStepSensor
      • AUnityContextInit
      • AUnityEffector
      • AUnitySensor
      • AUnityTokenAssign
      • AdditionalScenarioFile
      • AdvancedConfigurationParameterAttribute
      • Comment
      • DecisionTreeEvaluation
      • ExternalContextEntryAttribute
      • IScenarioEngine
      • ObsoleteFunctionAttribute
      • ObsoleteFunctionAttribute.ParameterConvesion
      • RuntimeScenarioFileRegistry
      • ScenarioEngine
      • ScenarioEngineKernel
      • ScenarioRunner
      • Section
    • Xareus.Scenarios.Unity.Edition
      • BusinessControl
      • Constants
      • ContextVariableManager
      • ContextVariableManager.SerializedContextVariables
      • IScenarioSerializer
      • IToolbarEntryData
      • Layer
      • Layer.UxmlFactory
      • Layer.UxmlTraits
      • LayerBar
      • LayerBar.UxmlFactory
      • LayerBar.UxmlTraits
      • LayerBarButton
      • LayerBarButton.UxmlFactory
      • LayerBarButton.UxmlTraits
      • ScenarioEditorExtendedInfoUpdater
      • ScenarioSerializer
      • ScenarioTabHandler
      • ScenarioTabHandler.LayerViewData
      • ScenarioTabHandler.LayerViewDataDictionary
      • ScenarioWrapper
      • ScenarioWrapper.ScenarioDataConsumers
      • SequenceType
      • SerializableScenario
      • Tab
      • Tab.UxmlFactory
      • Tab.UxmlTraits
      • ThemeManager
      • ThemeManager.ThemeChange
      • XmlUtils
    • Xareus.Scenarios.Unity.Edition.Events
      • ArcCreatedEvent
      • ArcDeletedEvent
      • ArcStartedEvent
      • CreateContextToFireEvent
      • DeselectedEventArgs
      • EventCallbackFunctor<EventType>
      • IEventCallbackFunctor
      • IScenarioEventHandler
      • IdChangeEvent
      • LabelChangeEvent
      • OpenExternalScenarioEventArgs
      • ScenarioDataChangedEventArgs
    • Xareus.Scenarios.Unity.Edition.UI
      • ABaseArcUI
      • AClickableElementUI
      • ADecisionArcPreviewUI
      • AMovableElementUI
      • AMovableElementUI.MovableElementUIMoved
      • ArcDirectionUI
      • ArcPreviewUI
      • ArcUI
      • ArrowToNodesDirectionUI
      • ArrowToNodesUI
      • BackgroundGrid
      • CanvasUI
      • CanvasUI.UxmlFactory
      • CanvasUI.UxmlTraits
      • CommentUI
      • ComplexSequenceUI
      • DecisionArcUI
      • DecisionNodeUI
      • DecisionUI
      • EffectorUI
      • ExternalScenarioUI
      • FalseDecisionArcPreviewUI
      • FalseDecisionArcUI
      • FalseOutUI
      • FinalUI
      • InitialUI
      • LayerUI
      • NodeUI
      • PartialTokenUI
      • PetriNetUI
      • PlaceUI
      • SMTransitionUI
      • SectionUI
      • SensorUI
      • SequenceUI
      • StateMachineUI
      • StateUI
      • TokenAssignUI
      • TokenMergeUI
      • TokenUI
      • TransitionUI
      • TrueDecisionArcPreviewUI
      • TrueDecisionArcUI
      • TrueOutUI
    • Xareus.Scenarios.Unity.MiddleVR
      • AUnityClusterEffector
      • VRCall
    • Xareus.Scenarios.Unity.Providers
      • IClassConstraintableExtension
      • IClassReceiverExtension
      • IConstraintable
      • IConstraintable<T>
      • IProvider
      • IProvider<T>
      • IReceiver
      • IReceiver<T>
      • ProvideConstraintAttribute
      • ProviderAttribute
      • ValueChangedEventArgs<T>
    • Xareus.Scenarios.Unity.VisualScripting
      • Constants
      • VisualScriptHolder
      • VisualScriptingEffector
      • VisualScriptingSensor
  • Unity Utils
    • Xareus.Unity
      • MethodParameters
    • Xareus.Unity.Utils
      • ClassTemplate
      • ClusterUtils
      • ColorUtils
      • FileUtils
      • StringUtils
      • UnityEditorUtils
      • UnityUtils
  • Unity Librairies
    • Xareus
      • StaticClassMemberValueSensor
    • Xareus.Relations.Scenarios
      • CheckTypeWithScenarioMemberValueSensor
      • InvokeTypeWithScenarioMethodEffector
      • SetTypeWithScenarioMemberValueEffector
    • Xareus.Scenarios.Input
      • KeyPressedSensor
    • Xareus.Scenarios.Relations
      • CheckXareusObjectTypeMemberValueSensor
      • CheckXareusTypeMemberValueSensor
      • CompareXareusTypesMembersValuesSensor
      • InvokeXareusObjectMethodEffector
      • RandomXareusObjectEffector
      • RandomXareusObjectEffector.Result
      • RandomXareusObjectWithTypeEffector
      • SelectXareusTypesFromListEffector
      • SetXareusTypeMemberValueEffector
    • Xareus.Scenarios.Relations.ParametersConverter
      • CheckXareusTypeMemberValueSensorConverter
      • CompareXareusTypesMembersValuesSensorConverter
      • TypeValueSensorParametersConverter
    • Xareus.Scenarios.Time.Unity
      • UnityTimeSensor
      • UnityTimeSensor.TimeType
    • Xareus.Scenarios.Unity
      • AInvokeMethodEffector
      • AnyInputSensor
      • ChangeColorEffector
      • ChangeParentEffector
      • ChangeTextEffector
      • CheckMemberValueSensor
      • CompareMembersValuesSensor
      • DistanceSensor
      • HasComponentOfTypeSensor
      • InvokeStaticMethodEffector
      • InvokeUnityObjectMethodEffector
      • LoadSceneEffector
      • LogEffector
      • ObjectClickedSensor
      • ObjectCollisionSensor
      • PlaySoundEffector
      • SceneLoadedSensor
      • ScreenFadeEffector
      • ScreenFadeEffector.FadeType
      • SelectChildObjects
      • SelectComponents
      • SetActiveEffector
      • SetEnabledEffector
      • SetMemberValueEffector
      • StartDisplaySpriteEffector
      • StartDisplayTextAssetEffector
      • StartDisplayVideoClipEffector
      • StopAudioSourceEffector
      • StopDisplaySpriteEffector
      • StopDisplayTextAssetEffector
      • StopDisplayVideoClipEffector
      • UnityEventSensor
      • UnityNumberSensor
    • Xareus.Scenarios.Unity.UI
      • ButtonClickedSensor
      • DropdownSensor
      • ToggleValueSensor
      • ToggleValueSensor.SelectMode
    • Xareus.Scenarios.Unity.Utils
      • CompareMembersValuesSensorUpdater
      • ObjectCollisionSensorUpdater
    • Xareus.Unity
      • CheckMethodReturnValueSensor
      • DefaultUnityContextInit
      • DefaultUnityTokenUpdate
      • ScreenFadeEffect
      • SetValueInContextEffector
      • UFEOtherTrigger

Class Scenario

Partial part of the scenario class that handles compatibility with previous XSD versions

Inheritance
object
Extendable
Identifiable
Scenario
Inherited Members
Identifiable.Parent
Identifiable.Root
Identifiable.decoration
Identifiable.id
Identifiable.label
Extendable.extendedInfo
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Xareus.Scenarios
Assembly: Xareus.Scenarios.dll
Syntax
[Serializable]
public class Scenario : Identifiable

Constructors

Scenario(string, string)

Constructor

Declaration
public Scenario(string id, string label = "")
Parameters
Type Name Description
string id

The Id must be unique

string label

The label (optional)

Properties

Enabled

True if the scenario is enabled (i.e. NextStep can be called) When set to false, all of the sensors will stop checking

Declaration
public bool Enabled { get; set; }
Property Value
Type Description
bool

ExternalContext

The external context used by the scenario

Declaration
public IContext ExternalContext { get; }
Property Value
Type Description
IContext

InstanceId

The instanceId of the scenario (should be unique)

Declaration
public string InstanceId { get; }
Property Value
Type Description
string

IsDoingAStep

True if the scenario is currently performing a new step (i.e. NextStep has been called and is not finished yet)

Declaration
public bool IsDoingAStep { get; }
Property Value
Type Description
bool

IsExternalScenario

True if this scenario is used as an external scenario

Declaration
public bool IsExternalScenario { get; }
Property Value
Type Description
bool

LoadedScenarios

All Loaded Scenarios

Declaration
public static List<Scenario> LoadedScenarios { get; }
Property Value
Type Description
List<Scenario>

PathId

Complete (unique) path ID

Declaration
public override string PathId { get; }
Property Value
Type Description
string
Overrides
Identifiable.PathId

ScenarioContext

The scenario context

Declaration
public IContext ScenarioContext { get; }
Property Value
Type Description
IContext

ScenarioFile

The file path of the current scenario (can be null)

Declaration
public string ScenarioFile { get; set; }
Property Value
Type Description
string

ScenarioState

The state of the current scenario

Declaration
public ScenarioState ScenarioState { get; set; }
Property Value
Type Description
ScenarioState

ScenarioText

The text representation of the scenario that has been loaded

Declaration
public string ScenarioText { get; }
Property Value
Type Description
string

Version

The version of the scenario. Can be used to update the XML data when needed for backward compatibility

Declaration
public Version Version { get; set; }
Property Value
Type Description
Version

assignment

Declaration
public virtual List<Assignment> assignment { get; set; }
Property Value
Type Description
List<Assignment>

contextInit

Declaration
public virtual Function contextInit { get; set; }
Property Value
Type Description
Function

sequence

Declaration
public virtual ASequence sequence { get; set; }
Property Value
Type Description
ASequence

version

Declaration
public virtual string version { get; set; }
Property Value
Type Description
string

Methods

AddScenarioText(string, string)

Reads a scenario text and stores it if the ID is not already present. Uses scenarioID as ID

Declaration
public static bool AddScenarioText(string scenarioID, string scenarioText)
Parameters
Type Name Description
string scenarioID

The ID of the scenario

string scenarioText

The XML contents defining the scenario

Returns
Type Description
bool

True if the file hase been read, false otherwise (already present or an error occured)

AddScenarioTextFile(string, string)

Reads a scenario text and stores it.

Declaration
[Obsolete("AddScenarioTextFile is deprecated, please use AddScenarioText or ReadFileText instead.")]
public static bool AddScenarioTextFile(string scenarioFile, string scenarioText)
Parameters
Type Name Description
string scenarioFile

The XML file containing the scenario text

string scenarioText

The XML contents defining the scenario

Returns
Type Description
bool

True if the file hase been read, false otherwise (already present or an error occured)

AddScenarioTextForFile(string, string)

Reads a scenario text and stores it. Note that the file is not read but its name is used for reference This is kind of a hack for Unity that uses assets and looses relative paths in the process

Declaration
public static bool AddScenarioTextForFile(string scenarioFile, string scenarioText)
Parameters
Type Name Description
string scenarioFile

The XML file containing the scenario text

string scenarioText

The XML contents defining the scenario

Returns
Type Description
bool

True if the file hase been read, false otherwise (already present or an error occured)

ComputeDecorations(Transition)

Declaration
public Dictionary<string, List<Decoration>> ComputeDecorations(Transition transition)
Parameters
Type Name Description
Transition transition
Returns
Type Description
Dictionary<string, List<Decoration>>

ConvertTo4_1(XmlDocument, XmlNode, XmlNamespaceManager)

Convert document to 4.1

Declaration
protected static void ConvertTo4_1(XmlDocument inputDoc, XmlNode scenarioNode, XmlNamespaceManager nsManager)
Parameters
Type Name Description
XmlDocument inputDoc
XmlNode scenarioNode
XmlNamespaceManager nsManager

ConvertTo4_2(XmlDocument, XmlNode, XmlNamespaceManager)

Convert document to 4.2

Declaration
protected static void ConvertTo4_2(XmlDocument inputDoc, XmlNode scenarioNode, XmlNamespaceManager nsManager)
Parameters
Type Name Description
XmlDocument inputDoc
XmlNode scenarioNode
XmlNamespaceManager nsManager

ConvertTo5_0(XmlDocument, XmlNode, XmlNamespaceManager)

Convert document to 5.0

Declaration
protected static void ConvertTo5_0(XmlDocument inputDoc, XmlNode scenarioNode, XmlNamespaceManager nsManager)
Parameters
Type Name Description
XmlDocument inputDoc
XmlNode scenarioNode
XmlNamespaceManager nsManager

ConvertTo5_7_0(XmlDocument, XmlNode, XmlNamespaceManager)

Convert document to 5.0

Declaration
protected static void ConvertTo5_7_0(XmlDocument inputDoc, XmlNode scenarioNode, XmlNamespaceManager nsManager)
Parameters
Type Name Description
XmlDocument inputDoc
XmlNode scenarioNode
XmlNamespaceManager nsManager

GetActivableSensors()

Gets the conditions currently under validation in the execution of the scenario.

Declaration
public IEnumerable<ASensor> GetActivableSensors()
Returns
Type Description
IEnumerable<ASensor>

The conditions under validation

GetActivableSensors(List<Assignment>)

Gets the conditions currently under validation in the execution of the scenario. The result is filtered using a list of assignments.

Declaration
public IEnumerable<ASensor> GetActivableSensors(List<Assignment> assignmentList)
Parameters
Type Name Description
List<Assignment> assignmentList

The list of assignments

Returns
Type Description
IEnumerable<ASensor>

The conditions under validation

GetAllFunctions()

Get all the functions used in the scenario

Declaration
public IEnumerable<Function> GetAllFunctions()
Returns
Type Description
IEnumerable<Function>

The functions used in the scenario

GetAllInstantiatedFunctions()

Get all the instantiated functions used in the scenario

Declaration
public IEnumerable<AFunction> GetAllInstantiatedFunctions()
Returns
Type Description
IEnumerable<AFunction>

The instantiated functions used in the scenario

GetAllSequences()

Get all the sequences in the scenario

Declaration
public IEnumerable<ASequence> GetAllSequences()
Returns
Type Description
IEnumerable<ASequence>

The sequences

GetAllTransitions()

Get all the transitions of the sequence

Declaration
public IEnumerable<Transition> GetAllTransitions()
Returns
Type Description
IEnumerable<Transition>

All the transitions

GetEnabledTransitions()

Get the enabled transitions of the sequence

Declaration
public IEnumerable<Transition> GetEnabledTransitions()
Returns
Type Description
IEnumerable<Transition>

The enabled transitions

GetEnabledTransitions(List<Assignment>)

Get the enabled transitions of the sequence The result is filtered using a list of assignments.

Declaration
public IEnumerable<Transition> GetEnabledTransitions(List<Assignment> assignmentList)
Parameters
Type Name Description
List<Assignment> assignmentList

The list of assignments

Returns
Type Description
IEnumerable<Transition>

The enabled transitions

GetExternalScenariosFiles(bool)

Get all the external scenarios' files directly or indirectly referenced by this scenario

Declaration
public HashSet<string> GetExternalScenariosFiles(bool relativeToRoot = false)
Parameters
Type Name Description
bool relativeToRoot

Get all paths relative to the root scenario

Returns
Type Description
HashSet<string>

The external scenarios files paths

GetFiringTransitions()

Declaration
public IEnumerable<Transition> GetFiringTransitions()
Returns
Type Description
IEnumerable<Transition>

GetScenarioFromText(string)

Deserializes a scenario from an XML string. Updates the scenario xml if needed This doesn't load or initializes the scenario

Declaration
public static Scenario GetScenarioFromText(string scenarioText)
Parameters
Type Name Description
string scenarioText
Returns
Type Description
Scenario

GetSequencesThatHoldTokens()

Get all the sequences that hold a token

Declaration
public IEnumerable<ASequence> GetSequencesThatHoldTokens()
Returns
Type Description
IEnumerable<ASequence>

The sequences that hold a token

GetTransitions(List<Assignment>)

Get all the transitions of the sequence The result is filtered using a list of assignments.

Declaration
public IEnumerable<Transition> GetTransitions(List<Assignment> assignmentList)
Parameters
Type Name Description
List<Assignment> assignmentList

The list of assignments

Returns
Type Description
IEnumerable<Transition>

All the transitions with the given assignement

IsFinished()

Checks if the scenario is finished

Declaration
public bool IsFinished()
Returns
Type Description
bool

true if the scenario is over; false if it can still progress

LoadFromFile(string, object, ScenarioLoadingParameters, bool)

Declaration
[Obsolete("Use LoadFromFile(string, IContext, ScenarioLoadingParameters, bool) instead")]
public static Scenario LoadFromFile(string scenarioFile, object externalContext, ScenarioLoadingParameters loadingParameters = null, bool isExternal = false)
Parameters
Type Name Description
string scenarioFile
object externalContext
ScenarioLoadingParameters loadingParameters
bool isExternal
Returns
Type Description
Scenario

LoadFromFile(string, string, object, ScenarioLoadingParameters, bool)

Declaration
[Obsolete("Use LoadFromFile(string, string, IContext, ScenarioLoadingParameters, bool) instead")]
public static Scenario LoadFromFile(string scenarioFile, string relativePath, object externalContext, ScenarioLoadingParameters loadingParameters = null, bool isExternal = false)
Parameters
Type Name Description
string scenarioFile
string relativePath
object externalContext
ScenarioLoadingParameters loadingParameters
bool isExternal
Returns
Type Description
Scenario

LoadFromFile(string, string, IContext, ScenarioLoadingParameters, bool)

Loads a scenario from its XML file and an external context. Uses scenarioFile as ID. If the ID doesn't already exists, reads the file first

Declaration
public static Scenario LoadFromFile(string scenarioFile, string relativePath, IContext externalContext, ScenarioLoadingParameters loadingParameters = null, bool isExternal = false)
Parameters
Type Name Description
string scenarioFile

The XML file defining the scenario

string relativePath

The path relative to which to load the scenario file

IContext externalContext

The context external to the scenario

ScenarioLoadingParameters loadingParameters
bool isExternal

If set to true, the scenario will be marked as external (i.e. loaded by another scenario)

Returns
Type Description
Scenario

The scenario

LoadFromFile(string, IContext, ScenarioLoadingParameters, bool)

Loads a scenario from its XML file and an external context.. If the ID doesn't already exists, reads the file first

Declaration
public static Scenario LoadFromFile(string scenarioFile, IContext externalContext, ScenarioLoadingParameters loadingParameters = null, bool isExternal = false)
Parameters
Type Name Description
string scenarioFile

The XML file defining the scenario

IContext externalContext

The context external to the scenario

ScenarioLoadingParameters loadingParameters
bool isExternal

If set to true, the scenario will be marked as external (i.e. loaded by another scenario)

Returns
Type Description
Scenario

The scenario

LoadFromText(string, object, ScenarioLoadingParameters, bool)

Declaration
[Obsolete("Use LoadFromText(string, IContext, ScenarioLoadingParameters, bool) instead")]
public static Scenario LoadFromText(string scenarioText, object externalContext, ScenarioLoadingParameters loadingParameters = null, bool isExternal = false)
Parameters
Type Name Description
string scenarioText
object externalContext
ScenarioLoadingParameters loadingParameters
bool isExternal
Returns
Type Description
Scenario

LoadFromText(string, IContext, ScenarioLoadingParameters, bool)

Loads a scenario from its XML contents and an external context.

Declaration
public static Scenario LoadFromText(string scenarioText, IContext externalContext, ScenarioLoadingParameters loadingParameters = null, bool isExternal = false)
Parameters
Type Name Description
string scenarioText

The XML contents defining the scenario

IContext externalContext

The context external to the scenario

ScenarioLoadingParameters loadingParameters
bool isExternal

If set to true, the scenario will be marked as external (i.e. loaded by another scenario)

Returns
Type Description
Scenario

The scenario

LoadScenario(Scenario, IContext, ScenarioLoadingParameters, bool, string)

Loads a scenario, meaning initializes it and loads its external scenarios

Declaration
public static Scenario LoadScenario(Scenario scenario, IContext externalContext, ScenarioLoadingParameters loadingParameters = null, bool isExternal = false, string scenarioFilePath = null)
Parameters
Type Name Description
Scenario scenario
IContext externalContext
ScenarioLoadingParameters loadingParameters

The parameters to use to load the scenario

bool isExternal

If set to true, the scenario will be marked as external (i.e. loaded by another scenario)

string scenarioFilePath
Returns
Type Description
Scenario

LoadScenarioState(string)

Reads and loads from an XML file the state of the scenario

Declaration
public void LoadScenarioState(string scenarioStateFile)
Parameters
Type Name Description
string scenarioStateFile

The input XML file

NextStep(bool)

Performs a step of the execution of the scenario.

Declaration
public bool NextStep(bool oneStepOnly = false)
Parameters
Type Name Description
bool oneStepOnly

If true, only performs one atomic step

Returns
Type Description
bool

true whether the scenario was updated; false whether the scenario was not updated (not enabled or already performing a new step)

ReadFileText(string)

Reads a scenario file text, stores it and returns it

Declaration
public static Scenario ReadFileText(string scenarioFile)
Parameters
Type Name Description
string scenarioFile

The XML file defining the scenario

Returns
Type Description
Scenario

RenameXmlNode(XmlDocument, XmlNode, string)

Renames and XML node in the given document

Declaration
protected static void RenameXmlNode(XmlDocument doc, XmlNode nodeToRename, string newname)
Parameters
Type Name Description
XmlDocument doc
XmlNode nodeToRename
string newname

Reset()

Remove all tokens and recreate the initial ones

Declaration
public void Reset()

SaveScenarioState(string)

Extract and save to an XML file the state of the scenario

Declaration
public void SaveScenarioState(string scenarioStateFile)
Parameters
Type Name Description
string scenarioStateFile

The output XML file

SaveToFile(string, Scenario)

Saves a scenario in an XML file

Declaration
public static bool SaveToFile(string scenarioFile, Scenario scenario)
Parameters
Type Name Description
string scenarioFile

The output XML file to save

Scenario scenario

The scenario to save

Returns
Type Description
bool

True if the operation succedded

UpdateScenarioText(string)

This method will update the XML string depending on the scenario version detected

Declaration
public static string UpdateScenarioText(string scenarioText)
Parameters
Type Name Description
string scenarioText

The complete XML scenario text that must be updated to the current version

Returns
Type Description
string

Events

ScenarioBeforeLoadEvent

Event fire before a scenario is loaded

Declaration
public static event EventHandler ScenarioBeforeLoadEvent
Event Type
Type Description
EventHandler
See Also
LoadScenario(Scenario, IContext, ScenarioLoadingParameters, bool, string)

ScenarioLoadedEvent

Event fired when a scenario is loaded

Declaration
public static event EventHandler<ScenarioLoadedEventArgs> ScenarioLoadedEvent
Event Type
Type Description
EventHandler<ScenarioLoadedEventArgs>
See Also
LoadScenario(Scenario, IContext, ScenarioLoadingParameters, bool, string)

StateChangedEvent

Event fired when the scenario state is changed

Declaration
public event EventHandler StateChangedEvent
Event Type
Type Description
EventHandler

Extension Methods

ExtendedInfoHelper.AddExtendedInfoElementArrayValue<T>(Extendable, string, string, string, T)
ExtendedInfoHelper.GetExtendedInfoAttributeValue<T>(Extendable, string, string, string, T)
ExtendedInfoHelper.GetExtendedInfoElementArrayCount(Extendable, string, string, string)
ExtendedInfoHelper.GetExtendedInfoElementArray<T>(Extendable, string, string, string, int)
ExtendedInfoHelper.GetExtendedInfoRoot(Extendable, string)
ExtendedInfoHelper.GetExtendedInfoValue<T>(Extendable, string, string, T)
ExtendedInfoHelper.HasExtendedInfoElement(Extendable, string, string, string)
ExtendedInfoHelper.HasExtendedInfoRoot(Extendable, string)
ExtendedInfoHelper.RemoveExtendedInfoElement(Extendable, string, string, string)
ExtendedInfoHelper.RemoveExtendedInfoElementArrayValue(Extendable, string, string, string, int)
ExtendedInfoHelper.RemoveExtendedInfoRoot(Extendable, string)
ExtendedInfoHelper.RenameExtendedInfoRoot(Extendable, string, string)
ExtendedInfoHelper.SetExtendedInfoAttributeValue<T>(Extendable, string, string, string, T)
ExtendedInfoHelper.SetExtendedInfoAttributeValue<T>(Extendable, string, string, T)
ExtendedInfoHelper.SetExtendedInfoElementArrayValue<T>(Extendable, string, string, string, T, int)
ExtendedInfoHelper.SetExtendedInfoElementValue<T>(Extendable, string, string, string, T)
ExtendedInfoHelper.SetExtendedInfoElementValue<T>(Extendable, string, string, T)
INSA     IRISA     Inria     Ouest Valorisation Back to top