@OpenApiAll public final class ALH extends java.lang.Object
| Constructor and Description |
|---|
ALH()
Constructor.
|
ALH(SimulationSession session)
Constructor.
|
ALH(SimulationSession session,
java.util.List<NamedElement> trace)
Constructor.
|
ALH(SimulationSession session,
java.util.List<NamedElement> trace,
fUML.Semantics.Classes.Kernel.Object_ context)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Object value)
Find the matched
FeatureValue from the specified object,
and set the value at the last position of the value list. |
void |
addValueAt(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Object value,
java.lang.Integer insertAt)
Find the matched
FeatureValue from the specified object,
and set the value at the insertAt position. |
java.lang.Object |
callBehavior(java.lang.String name)
Execute the
Behavior element that matches the specified name. |
java.lang.Object |
callBehavior(java.lang.String name,
java.util.List<?> arguments)
Execute the CallBehaviorAction element that matches the specified name.
|
java.lang.Object |
callBehavior(java.lang.String name,
java.util.List<?> arguments,
boolean isSynchonous)
Execute the CallBehaviorAction element that matches the specified name.
|
java.lang.Object |
callOperation(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String name)
Execute the method of the
Operation element that matches the specified name. |
java.lang.Object |
callOperation(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String name,
java.util.List<?> arguments)
Execute the method of the
Operation element that matches the specified name. |
java.lang.Object |
callOperation(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String name,
java.util.List<?> arguments,
boolean isSynchonous)
Execute the method of the
Operation element that matches the specified name. |
java.lang.Object |
callOperation(java.lang.String name)
Execute the method of the
Operation element that matches the specified name. |
java.lang.Object |
callOperation(java.lang.String name,
java.util.List<?> arguments)
Execute the method of the
Operation element that matches the specified name. |
java.util.ArrayList<java.lang.Object> |
createList()
A convenience method for creating the list.
|
java.util.ArrayList<java.lang.Object> |
createList(java.lang.Object object)
A convenience method for creating the list with one added item in the list.
|
fUML.Semantics.Classes.Kernel.Object_ |
createObject(Class classifier)
Create an
Object_ with the given type (which must be a Class) in the Locus of the active SimulationSession. |
fUML.Semantics.Classes.Kernel.Object_ |
createObject(java.lang.String name)
Create an
Object_ with the given name (which must be name of Class)
as its type. |
fUML.Semantics.CommonBehaviors.Communications.SignalInstance |
createSignal(Signal signal)
Create the instance of
SignalInstance. |
fUML.Semantics.CommonBehaviors.Communications.SignalInstance |
createSignal(java.lang.String keyword)
Create the instance of
SignalInstance. |
java.lang.Object |
evaluate(java.lang.String expression)
Evaluate the string expression.
|
java.lang.Object |
evaluate(java.lang.String language,
java.lang.String expression)
Evaluate the string expression based on the specified scripting language.
|
NamedElement |
getCaller()
Get the calling element of the script evaluation.
|
fUML.Semantics.Classes.Kernel.Object_ |
getContext()
Get the context of ALH.
|
double |
getCurrentTime()
Gets current time.
|
double |
getCurrentTime(java.lang.String timeUnit)
Gets current time in forms of the specified
timeUnit. |
java.lang.Object |
getGlobalVariable(java.lang.String variableName)
Gets global variable from the execution.
|
fUML.Semantics.CommonBehaviors.Communications.SignalInstance |
getLastSignal(fUML.Semantics.Classes.Kernel.Object_ o)
Get the last signal instance from the event pool.
|
State |
getState(fUML.Semantics.Classes.Kernel.Object_ object)
Get the current
State from the specified object. |
java.lang.Object |
getTagValue(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String tagName)
Get tag value from classifier of Object.
|
java.lang.Object |
getTagValue(java.lang.String tagName)
Get tag value from classifier of context.
|
java.lang.String |
getTimeUnit()
Gets time unit of the running execution.
|
java.lang.Object |
getTokenValue()
Get Tokens values from the current context.
|
java.lang.Object |
getValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName)
Get the value of
FeatureValue from the object that match
the specified StrucutureFeature name. |
boolean |
inState(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String stateName)
Check whether the specified object is in the specified state name or not.
|
boolean |
inState(java.lang.String stateName)
Check whether the current runtime object is in the specified state name or not.
|
java.lang.Boolean |
isGlobalVariable(java.lang.String variableName)
Checks whether or not the given
variableName is global variable. |
void |
removeGlobalVariable(java.lang.String variableName)
Removes global variable from the execution.
|
void |
removeValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
fUML.Semantics.Classes.Kernel.Value value)
Find the matched
FeatureValue from the specified object,
remove the defined value or the value at removeAt position. |
void |
removeValueAt(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Integer removeAt)
Find the matched
FeatureValue from the specified object,
remove the defined value or the value at removeAt position. |
void |
sendSignal(fUML.Semantics.CommonBehaviors.Communications.SignalInstance signal,
fUML.Semantics.Classes.Kernel.Object_ target)
Send the specified
SignalInstance to the specified target Object_. |
void |
sendSignal(fUML.Semantics.CommonBehaviors.Communications.SignalInstance signal,
fUML.Semantics.Classes.Kernel.Object_ target,
java.lang.String portName)
Send the specified
SignalInstance to the specified target Object_ via the specified port name. |
void |
sendSignal(fUML.Semantics.CommonBehaviors.Communications.SignalInstance signal,
java.lang.String targetName)
Send the specified
SignalInstance to the specified targetName. |
void |
sendSignal(java.lang.String signalName,
fUML.Semantics.Classes.Kernel.Object_ target)
Create SignalInstance instance of the specified
Signal name, and send it to the target Object_.
If signalName contains "::", it will find the signal from the qualified name, the signal is found if its qualified name is ended with signalName. |
void |
sendSignal(java.lang.String signalName,
fUML.Semantics.Classes.Kernel.Object_ target,
java.lang.String portName)
Create SignalInstance instance of the specified
Signal name, and send it to the target Object_ via the specified port name.
If signalName contains "::", it will find the signal from the qualified name, the signal is found if its qualified name is ended with signalName. |
void |
sendSignal(java.lang.String signalName,
java.lang.String targetName)
Create SignalInstance instance of the specified
Signal name, and send it to the specified targetName.
If signalName contains "::", it will find the signal from the qualified name, the signal is found if its qualified name is ended with signalName.
If targetName is defined, there are two possible cases. |
void |
setGlobalVariable(java.lang.String variableName,
java.lang.Object value)
Sets global variable for the execution.
|
void |
setValue(java.lang.String featureName,
java.lang.Object value)
Find the matched
FeatureValue from the context, and set the value. |
void |
setValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Object value)
Find the matched
FeatureValue from the specified object, and set the value. |
boolean |
wasInState(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String stateName)
Check that the state matching with the name was already visited or not.
|
boolean |
wasInState(java.lang.String stateName)
Check that the state matching with the name was already visited or not.
|
public ALH()
public ALH(SimulationSession session)
session - the running sessionpublic ALH(SimulationSession session, java.util.List<NamedElement> trace)
session - the running sessiontrace - tracepublic ALH(SimulationSession session, java.util.List<NamedElement> trace, fUML.Semantics.Classes.Kernel.Object_ context)
session - the running sessiontrace - tracecontext - the contextpublic fUML.Semantics.Classes.Kernel.Object_ getContext()
public java.lang.Object getValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName)
FeatureValue from the object that match
the specified StrucutureFeature name. It supports nested structural features.object - the specified instance of StructuredValue(or its subclasses)featureName - the specified name, it will check with StructuralFeature name, nested structural features such as "part1.part2" are allowed.FeatureValuejava.lang.IllegalArgumentException - if object or featureName is null.fUMLHelper.getFeatureValueByName(StructuredValue, String),
fUMLHelper.getObjectFromFeatureValue(FeatureValue)public void setValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Object value)
FeatureValue from the specified object, and set the value.
If not found, create the new FeatureValue and add to the specified object.
It supports nested structural features.
If want to find FeatureValue from Association(Link),
use fUMLHelper#addFeatureValues(Locus locus, StructuredValue valueOwner, StructuralFeature feature, ValueList inputValues, int insertAt, boolean replaceAll)
object - the fUML runtime Object_ or SignalInstancefeatureName - the name of structural feature, nested structural features such as "part1.part2" are allowed.value - the value to be set. Can be Java value or fUML Value.java.lang.IllegalArgumentException - if object or featureName is null.fUMLHelper.setFeatureValue(StructuredValue, StructuralFeature, Object)public void setValue(java.lang.String featureName,
java.lang.Object value)
FeatureValue from the context, and set the value.
If not found, create the new FeatureValue and add to the context.
It supports nested structural features.
If want to find FeatureValue from Association(Link),
use fUMLHelper#addFeatureValues(Locus locus, StructuredValue valueOwner, StructuralFeature feature, ValueList inputValues, int insertAt, boolean replaceAll)
featureName - the name of structural feature, nested structural features such as "part1.part2" are allowed.value - the value to be set. Can be Java value or fUML Value.java.lang.IllegalArgumentException - if object or featureName is null.fUMLHelper.setFeatureValue(StructuredValue, StructuralFeature, Object)public void addValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Object value)
FeatureValue from the specified object,
and set the value at the last position of the value list.object - the fUML runtime Object_ or SignalInstancefeatureName - the name of structural feature, nested structural features such as "part1.part2" are allowed.value - the value to be set. Can be Java value or fUML Value.public void addValueAt(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Object value,
java.lang.Integer insertAt)
FeatureValue from the specified object,
and set the value at the insertAt position.object - the fUML runtime Object_ or SignalInstancefeatureName - the name of structural feature, nested structural features such as "part1.part2" are allowed.value - the value to be set. Can be Java value or fUML Value.insertAt - the inserted position. if it is not more than 0, the value will be added at the last position.public void removeValue(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
fUML.Semantics.Classes.Kernel.Value value)
FeatureValue from the specified object,
remove the defined value or the value at removeAt position.object - the fUML runtime Object_ or SignalInstancefeatureName - the name of structural feature, nested structural features such as "part1.part2" are allowed.value - the fUML value to be removed.public void removeValueAt(fUML.Semantics.Classes.Kernel.StructuredValue object,
java.lang.String featureName,
java.lang.Integer removeAt)
FeatureValue from the specified object,
remove the defined value or the value at removeAt position.object - the fUML runtime Object_ or SignalInstancefeatureName - the name of structural feature, nested structural features such as "part1.part2" are allowed.removeAt - if the removeAt is defined. it will remove the value at removeAt position, ignoring the value valuepublic State getState(fUML.Semantics.Classes.Kernel.Object_ object)
State from the specified object.
If object has more than one active states, return the first one.object - the instance of Object_(or its subclasses)State from the specified objectjava.lang.IllegalArgumentException - if object is null.public java.lang.Object getTokenValue()
Object representing the token values of the current contextpublic fUML.Semantics.CommonBehaviors.Communications.SignalInstance getLastSignal(fUML.Semantics.Classes.Kernel.Object_ o)
o - the specified objectpublic fUML.Semantics.Classes.Kernel.Object_ createObject(Class classifier)
Object_ with the given type (which must be a Class) in the Locus of the active SimulationSession.classifier - the instance of Class(or its subclasses)Object_, or null if classifier is not instance of Classpublic fUML.Semantics.Classes.Kernel.Object_ createObject(java.lang.String name)
Object_ with the given name (which must be name of Class)
as its type. The name is used to search from com.nomagic.uml2.ext.magicdraw.auxiliaryconstructs.mdmodels.Model of the current Project.name - the specified Class nameObject_createObject(Class),
SimulationModelHelper.findClassByName(Element, String)public java.lang.Object callOperation(java.lang.String name)
Operation element that matches the specified name.name - the specified name of OperationcallOperation(String, List)public java.lang.Object callOperation(java.lang.String name,
java.util.List<?> arguments)
Operation element that matches the specified name.name - the specified name of Operationarguments - argument valuescallOperation(Object_, String, List)public java.lang.Object callOperation(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String name)
Operation element that matches the specified name.object - The target object to which the request is sentname - the specified name of OperationcallOperation(Object_, String, List)public java.lang.Object callOperation(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String name,
java.util.List<?> arguments)
Operation element that matches the specified name.object - The target object to which the request is sentname - the specified name of Operationarguments - argument valuesSimulationModelHelper.findOperationByName(Element, String),
fUMLHelper#callBehavior(Object_, Behavior, List, SimulationSession, Boolean)public java.lang.Object callOperation(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String name,
java.util.List<?> arguments,
boolean isSynchonous)
Operation element that matches the specified name.object - The target object to which the request is sentname - the specified name of Operationarguments - argument valuesisSynchonous - true if call synchronously, false --> asynchronouslySimulationModelHelper.findOperationByName(Element, String),
fUMLHelper#callBehavior(Object_, Behavior, List, SimulationSession, Boolean)public java.lang.Object callBehavior(java.lang.String name)
Behavior element that matches the specified name.name - the specified name of BehaviorcallBehavior(String, List)public java.lang.Object callBehavior(java.lang.String name,
java.util.List<?> arguments)
name - the specified name of Behaviorarguments - argument valuesjava.lang.IllegalArgumentException - if cannot find Behavior or size of arguments are not equal to in/inout parameters size.fUMLHelper#callBehavior(Object_, Behavior, List, SimulationSession, Boolean)public java.lang.Object callBehavior(java.lang.String name,
java.util.List<?> arguments,
boolean isSynchonous)
name - the specified name of Behaviorarguments - argument valuesisSynchonous - true if call synchronously, false --> asynchronouslyjava.lang.IllegalArgumentException - if cannot find Behavior or size of arguments are not equal to in/inout parameters size.fUMLHelper#callBehavior(Object_, Behavior, List, SimulationSession, Boolean)public void sendSignal(java.lang.String signalName,
fUML.Semantics.Classes.Kernel.Object_ target)
Signal name, and send it to the target Object_.
If signalName contains "::", it will find the signal from the qualified name, the signal is found if its qualified name is ended with signalName.signalName - the specified Signal nametarget - the specified target Object_public void sendSignal(java.lang.String signalName,
java.lang.String targetName)
Signal name, and send it to the specified targetName.
If signalName contains "::", it will find the signal from the qualified name, the signal is found if its qualified name is ended with signalName.
If targetName is defined, there are two possible cases.
targetNametargetNamesignalName - the specified Signal nametargetName - the specified target object namepublic void sendSignal(java.lang.String signalName,
fUML.Semantics.Classes.Kernel.Object_ target,
java.lang.String portName)
Signal name, and send it to the target Object_ via the specified port name.
If signalName contains "::", it will find the signal from the qualified name, the signal is found if its qualified name is ended with signalName.signalName - the specified Signal nametarget - the specified target Object_portName - the specified port namepublic void sendSignal(fUML.Semantics.CommonBehaviors.Communications.SignalInstance signal,
fUML.Semantics.Classes.Kernel.Object_ target)
SignalInstance to the specified target Object_.signal - the specified SignalInstancetarget - the specified target Object_public void sendSignal(fUML.Semantics.CommonBehaviors.Communications.SignalInstance signal,
java.lang.String targetName)
SignalInstance to the specified targetName.
If targetName is defined, there are two possible cases.
targetNametargetNamesignal - the specified SignalInstancetargetName - the specified target object namepublic void sendSignal(fUML.Semantics.CommonBehaviors.Communications.SignalInstance signal,
fUML.Semantics.Classes.Kernel.Object_ target,
java.lang.String portName)
SignalInstance to the specified target Object_ via the specified port name.signal - the specified SignalInstancetarget - the specified target Object_portName - the specified port namepublic java.lang.Object evaluate(java.lang.String language,
java.lang.String expression)
language - the specified scripting languageexpression - the specified string expressionpublic java.lang.Object evaluate(java.lang.String expression)
expression - the specified string expressionpublic java.util.ArrayList<java.lang.Object> createList()
ArrayList is created and returned.ArrayListpublic java.util.ArrayList<java.lang.Object> createList(java.lang.Object object)
ArrayList is created and being added the specified item.object - the specified item being added to the created listArrayList with the added itempublic boolean inState(java.lang.String stateName)
stateName - the specified state namepublic boolean inState(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String stateName)
object - the specified objectstateName - the specified state namepublic boolean wasInState(java.lang.String stateName)
stateName - the state namepublic boolean wasInState(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String stateName)
object - the objectstateName - the state namepublic fUML.Semantics.CommonBehaviors.Communications.SignalInstance createSignal(Signal signal)
SignalInstance.signal - the specified SignalSignalInstancepublic fUML.Semantics.CommonBehaviors.Communications.SignalInstance createSignal(java.lang.String keyword)
SignalInstance.keyword - the keyword for find SignalSignalInstancepublic java.lang.String getTimeUnit()
public double getCurrentTime()
public double getCurrentTime(java.lang.String timeUnit)
timeUnit.timeUnit - StringtimeUnit.public java.lang.Object getGlobalVariable(java.lang.String variableName)
variableName - Variable namepublic void setGlobalVariable(java.lang.String variableName,
java.lang.Object value)
variableName - Variable namevalue - Variable valuepublic java.lang.Boolean isGlobalVariable(java.lang.String variableName)
variableName is global variable.variableName - Variable namevariableName is global variable. Otherwise, false.public void removeGlobalVariable(java.lang.String variableName)
variableName - Variable namepublic NamedElement getCaller()
public java.lang.Object getTagValue(java.lang.String tagName)
throws java.lang.Exception
tagName - the tag name possible to be the dot notation.java.lang.Exception - the exceptionpublic java.lang.Object getTagValue(fUML.Semantics.Classes.Kernel.Object_ object,
java.lang.String tagName)
throws java.lang.Exception
object - the runtime objecttagName - the tag name possible to be the dot notation.java.lang.Exception - the exception