![JAR search and dependency download from the Maven repository](/logo.png)
fUML.Semantics.Actions.BasicActions.SendSignalActionActivation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fuml Show documentation
Show all versions of fuml Show documentation
This open source software is a reference implementation, consisting of software and related files, for the OMG specification called the Semantics of a Foundational Subset for Executable UML Models (fUML). The reference implementation is intended to implement the execution semantics of UML activity models, accepting an XMI file from a conformant UML model as its input and providing an execution trace of the selected activity model(s) as its output. The core execution engine, which is directly generated from the normative syntactic and semantic models for fUML, may also be used as a library implementation of fUML in other software.
/*
* Initial version copyright 2008 Lockheed Martin Corporation, except
* as stated in the file entitled Licensing-Information.
*
* All modifications copyright 2009-2017 Data Access Technologies, Inc.
*
* Licensed under the Academic Free License version 3.0
* (http://www.opensource.org/licenses/afl-3.0.php), except as stated
* in the file entitled Licensing-Information.
*/
package fUML.Semantics.Actions.BasicActions;
import fUML.Syntax.Classes.Kernel.*;
import fUML.Syntax.CommonBehaviors.Communications.*;
import fUML.Syntax.Actions.BasicActions.*;
import fUML.Semantics.Classes.Kernel.*;
import fUML.Semantics.CommonBehaviors.Communications.*;
public class SendSignalActionActivation extends
fUML.Semantics.Actions.BasicActions.InvocationActionActivation {
public void doAction() {
// Get the value from the target pin. If the value is not a reference,
// then do nothing.
// Otherwise, construct a signal using the values from the argument pins
// and send it to the referent object.
SendSignalAction action = (SendSignalAction) (this.node);
Value target = this.takeTokens(action.target).getValue(0);
if (target instanceof Reference) {
Signal signal = action.signal;
SignalInstance signalInstance = new SignalInstance();
signalInstance.type = signal;
PropertyList attributes = signal.ownedAttribute;
InputPinList argumentPins = action.argument;
for (int i = 0; i < attributes.size(); i++) {
Property attribute = attributes.getValue(i);
InputPin argumentPin = argumentPins.getValue(i);
ValueList values = this.takeTokens(argumentPin);
signalInstance.setFeatureValue(attribute, values, 0);
}
SignalEventOccurrence signalEventOccurrence = new SignalEventOccurrence();
signalEventOccurrence.signalInstance = (SignalInstance) signalInstance.copy();
signalEventOccurrence.sendTo((Reference)target);
}
} // doAction
} // SendSignalActionActivation
© 2015 - 2025 Weber Informatics LLC | Privacy Policy