public class CommitActionsAttribute extends AbstractActionsAttribute implements CommitAction
The value of this attribute is a semicolon separated list of commands, where each command gives a destination and a value. The actions are given by calling setExpression() with a string of the form:
command; command; ...where each command has the form:
destination = expressionwhere destination is variableName, where variableName is either a variable or parameter of the FSM actor, or a variable or parameter of a refinement state. To give a variable of a refinement state, use a dotted name, as follows:
refinementStateName.variableName
The expression is a string giving an expression in the usual Ptolemy II expression language. The expression may include references to variables and parameters contained by the FSM actor.
The destination can also be a port, however, this is discouraged. Commit actions are not executed until postfire(), and the Ptolemy II abstract semantics requires that outputs be produced in fire(). Nonetheless, this is supported. In this case, the destination is either
portNameor
portName(channelNumber)Here, portName is the name of a port of the FSM actor, If no channelNumber is given, then the value is broadcast to all channels of the port. If destination name is given where there is both a port and a variable with that name, then the port will be used.
CommitActionsAttribute
,
Transition
,
FSMActor
Red (eal) |
Yellow (eal) |
NamedObj.ContainedObjectsIterator
Settable.Visibility
_destinationNames, _destinations, _destinationsListVersion, _parseTreeEvaluator, _parseTrees
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
EXPERT, FULL, NONE, NOT_EDITABLE
Constructor and Description |
---|
CommitActionsAttribute(Transition transition,
java.lang.String name)
Construct an action with the given name contained
by the specified transition.
|
CommitActionsAttribute(Workspace workspace)
Construct an action in the specified workspace with an empty
string as a name.
|
Modifier and Type | Method and Description |
---|---|
protected NamedObj |
_getDestination(java.lang.String name)
Given a destination name, return a NamedObj that matches that
destination.
|
void |
execute()
Send tokens to the designated outputs.
|
_getParserScope, clone, getChannelNumberList, getDestination, getDestinationNameList, getDestinations, getExpression, getParseTree, getParseTreeList, isChannelSpecified, setExpression, toString, typeConstraints
setContainer
_propagateValue, addValueListener, exportMoML, getExpression, getVisibility, removeValueListener, setVisibility, validate
getDefaultExpression, getValueAsString
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDisplayName
description, getContainer, getFullName, getName, getName, setName
public CommitActionsAttribute(Workspace workspace)
workspace
- The workspace that will list the attribute.public CommitActionsAttribute(Transition transition, java.lang.String name) throws IllegalActionException, NameDuplicationException
transition
- The transition that contains this action.name
- The name of this action.IllegalActionException
- If the action is not of an
acceptable class for the container.NameDuplicationException
- If the transition already
has an attribute with the name.public void execute() throws IllegalActionException
execute
in class AbstractActionsAttribute
IllegalActionException
- If expression evaluation fails,
or the specified port is not found, or sending to one of the
channels of the port throws a NoRoomException.protected NamedObj _getDestination(java.lang.String name) throws IllegalActionException
_getDestination
in class AbstractActionsAttribute
name
- The name of the destination, or null if none is found.IllegalActionException
- If the associated FSMActor
does not have a destination with the specified name.