Class BusinessControl
Overlayer for scenario data.
NOTE : Aims to ease scenario manipulation
Inheritance
BusinessControl
Assembly: Xareus.Scenarios.Unity.Edition.dll
Syntax
public class BusinessControl
Fields
EDITOR_CONFIGURATION_XML_NODE
Declaration
public static readonly string EDITOR_CONFIGURATION_XML_NODE
Field Value
SHOW_PRIORITY_XML_ATTRIBUTE
Declaration
public static readonly string SHOW_PRIORITY_XML_ATTRIBUTE
Field Value
Properties
RootSequence
Access the root sequence of the scenario. The sequence must be a Complex sequence.
Declaration
public ComplexSequence RootSequence { get; }
Property Value
Scenario
Access the scenario from the scenario wrapper
Declaration
public Scenario Scenario { get; }
Property Value
Methods
Declaration
public void AddComment(Comment comment)
Parameters
Type |
Name |
Description |
Comment |
comment |
|
AddSection(Section)
Declaration
public void AddSection(Section section)
Parameters
Type |
Name |
Description |
Section |
section |
|
AddSequence(ASequence, ComplexSequence)
Declaration
public void AddSequence(ASequence sequence, ComplexSequence parentSequence = null)
Parameters
AddTransition(Transition, ComplexSequence)
Declaration
public void AddTransition(Transition transition, ComplexSequence parentSequence)
Parameters
ConvertPetriNetToStateMachine(ComplexSequence)
Performs a user-triggered conversion from PetriNet to StateMachine
Declaration
public void ConvertPetriNetToStateMachine(ComplexSequence complexeSequence)
Parameters
ConvertStateMachineToPetriNet(ComplexSequence)
Performs a user-triggered conversion from StateMachine to PetriNet
Declaration
public void ConvertStateMachineToPetriNet(ComplexSequence complexeSequence)
Parameters
CreateAndAddArc(ArcPreviewUI, ComplexSequence)
Create an arc starting from the given source node and ending at a new destination node added to the provided sequence
Declaration
public void CreateAndAddArc(ArcPreviewUI previewArc, ComplexSequence parentSequence)
Parameters
CreateAndAddArc(ArcPreviewUI, NodeUI, ComplexSequence)
Create an arc starting from the given source node and ending at the given destination node and add it to the provided sequence
Declaration
public void CreateAndAddArc(ArcPreviewUI arcPreview, NodeUI destination, ComplexSequence parentSequence)
Parameters
Create a comment with an automatic name and add it to the provided sequence at the given position
Declaration
public Comment CreateAndAddComment(Vector2 position, Identifiable owner)
Parameters
Returns
CreateAndAddDecisionTree(Vector2, ComplexSequence, bool)
Create a decision tree with an automatic name and add it to the provided sequence at the given position
Declaration
public DecisionTree CreateAndAddDecisionTree(Vector2 position, ComplexSequence parentSequence, bool addDefaultElements = true)
Parameters
Returns
CreateAndAddExternalScenario(Vector2, ComplexSequence, string)
Create an external scenario from the given scenario file name and add it to the provided sequence at the given position
Declaration
public ExternalScenario CreateAndAddExternalScenario(Vector2 position, ComplexSequence parentSequence, string scenarioFileName = null)
Parameters
Returns
CreateAndAddPetriNet(Vector2, ComplexSequence, bool)
Create a petri net with an automatic name and add it to the provided sequence at the given position
Declaration
public SafePetriNet CreateAndAddPetriNet(Vector2 position, ComplexSequence parentSequence, bool addDefaultElements = true)
Parameters
Returns
CreateAndAddSection(Vector2, Identifiable)
Create a section with an automatic name and add it to the provided sequence at the given position
Declaration
public Section CreateAndAddSection(Vector2 position, Identifiable owner)
Parameters
Returns
CreateAndAddSequence(Vector2, ComplexSequence)
Create a place with an automatic name and add it to the provided sequence at the given position
Declaration
public ASequence CreateAndAddSequence(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
CreateAndAddStateMachine(Vector2, ComplexSequence, bool)
Create a state machine with an automatic name and add it to the provided sequence at the given position
Declaration
public StateMachine CreateAndAddStateMachine(Vector2 position, ComplexSequence parentSequence, bool addDefaultElements = true)
Parameters
Returns
CreateAndAddTransition(Vector2, ComplexSequence)
Create a transition with an automatic name and add it to the provided sequence at the given position
Declaration
public Transition CreateAndAddTransition(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
Declaration
public Comment CreateComment(Identifiable owner, Vector2 position)
Parameters
Returns
CreateDecisionTree(Vector2, ComplexSequence)
Creates a business object for a decision tree. The id of this objet is as such: "DecisionTree_{num} where {num} is the first free number in ascending order.
Declaration
public DecisionTree CreateDecisionTree(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
CreateExternalScenario(Vector2, ComplexSequence, string)
Creates an External scenario. The id of this objet is as such: "ExternalScenario_{num} where {num} is the first free number in ascending order.
Declaration
public ExternalScenario CreateExternalScenario(Vector2 position, ComplexSequence parentSequence, string scenarioFileName = "")
Parameters
Type |
Name |
Description |
Vector2 |
position |
|
ComplexSequence |
parentSequence |
|
string |
scenarioFileName |
the file containing the external scenario (default : "")
|
Returns
CreatePetriNet(Vector2, ComplexSequence)
Creates a business object for a net. The id of this objet is as such: "Net_{num} where {num} is the first free number in ascending order.
Declaration
public SafePetriNet CreatePetriNet(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
CreatePlace(Vector2, ComplexSequence)
Creates a place. The id of this objet is as such: "Place_{num} where {num} is the first free number in ascending order.
Declaration
public Place CreatePlace(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
CreateSMTransition(Vector2, ComplexSequence)
Creates a state machine transition. The id of this objet is as such: "Transition_{num} where {num} is the first free number in ascending order.
Declaration
public SMTransition CreateSMTransition(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
CreateSection(Identifiable, Vector2)
Declaration
public Section CreateSection(Identifiable owner, Vector2 position)
Parameters
Returns
CreateState(Vector2, ComplexSequence)
Creates a state. The id of this objet is as such: "State_{num} where {num} is the first free number in ascending order.
Declaration
public State CreateState(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
CreateStateMachine(Vector2, ComplexSequence)
Creates a business object for a state machine. The id of this objet is as such: "StateMachine_{num} where {num} is the first free number in ascending order.
Declaration
public StateMachine CreateStateMachine(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
CreateTransition(Vector2, ComplexSequence)
Creates a transition. The id of this objet is as such: "Transition_{num} where {num} is the first free number in ascending order.
Declaration
public Transition CreateTransition(Vector2 position, ComplexSequence parentSequence)
Parameters
Returns
DeleteArc(ArcUI)
Declaration
public void DeleteArc(ArcUI arc)
Parameters
Type |
Name |
Description |
ArcUI |
arc |
|
Declaration
public void DeleteComment(CommentUI commentUI)
Parameters
DeleteSection(SectionUI)
Declaration
public void DeleteSection(SectionUI sectionUI)
Parameters
DeleteSequenceWithArcs(SequenceUI)
Declaration
public void DeleteSequenceWithArcs(SequenceUI sequence)
Parameters
DeleteTransitionWithArcs(TransitionUI)
Declaration
public void DeleteTransitionWithArcs(TransitionUI transition)
Parameters
Fetches a comment within the scenario
Declaration
public Comment GetComment(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
Fetchs comments stored within an identifiable extented informations.
Declaration
public static List<Comment> GetComments(Identifiable identifiable)
Parameters
Returns
GetScenarioEvent(string)
Fetches an event within the scenario
Declaration
public Event GetScenarioEvent(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetScenarioSequence(string)
Fetches a sequence from its PathId within the Scenario
Uses a flattened view of the scenario
Declaration
public ASequence GetScenarioSequence(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetScenarioTransition(string)
Fetches a transition within the Scenario current layer
Uses a flattened view of the scenario
Declaration
public Transition GetScenarioTransition(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetSection(string)
Fetches a section within the scenario
Declaration
public Section GetSection(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetSections(Identifiable)
Fetchs sections stored within an identifiable extented informations.
Declaration
public static List<Section> GetSections(Identifiable identifiable)
Parameters
Returns
Import(Scenario, Vector2, string)
Imports the data of the given scenario in the given sequence
A conversion of the root data may occur if it's not directly compatible with the complex sequence type
Declaration
public IEnumerable<Identifiable> Import(Scenario scenario, Vector2 position, string complexSequenceId)
Parameters
Type |
Name |
Description |
Scenario |
scenario |
The scenario containing the data to import (that is, the root sequence)
|
Vector2 |
position |
The position to import the new data to (a translation of all imported data will be performed)
|
string |
complexSequenceId |
The complex sequence in which the data will be imported.
|
Returns
Initialize(ScenarioWrapper)
Associate an empty scenario holding a SafePetriNet to the control.
Declaration
public void Initialize(ScenarioWrapper scenarioWrapper)
Parameters
InitializeEmptyControl()
Creates an empty control with no data.
Declaration
public static BusinessControl InitializeEmptyControl()
Returns
ReInitialize(ScenarioWrapper)
Associate an empty scenario holding a SafePetriNet to the control.
Declaration
public void ReInitialize(ScenarioWrapper scenarioWrapper)
Parameters
Declaration
public void RemoveComment(Comment comment)
Parameters
Type |
Name |
Description |
Comment |
comment |
|
RemoveSection(Section)
Declaration
public void RemoveSection(Section section)
Parameters
Type |
Name |
Description |
Section |
section |
|
RemoveSequence(ASequence)
Declaration
public void RemoveSequence(ASequence sequenceArg)
Parameters
RemoveTransition(Transition)
Declaration
public void RemoveTransition(Transition transitionArg)
Parameters
ReplaceSequenceWithPetriNet(ASequence)
Convert a sequence to a Petri net.
Declaration
public void ReplaceSequenceWithPetriNet(ASequence sequence)
Parameters
Exceptions
ReplaceSequenceWithStateMachine(ASequence)
Convert the given sequence to a state machine. Note that data can be lost while performing this operation.
Declaration
public void ReplaceSequenceWithStateMachine(ASequence sequence)
Parameters
Exceptions