Page 1 of 1

Parameter values and corresponding name during Simulation

PostPosted: Sun Apr 07, 2019 3:17 pm
Hello together,

I want to retrieve values and get their corresponding name during the Simulation of an Activity.
I wrote an SimulationExecutionListener and worked on the method elementactivitated(element, values).
This method obtains the variable "values" as argument. "values" contains the tokens that are related to the behavior.
Code: Select all
public void elementActivated(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element element, java.util.Collection<?> values) {
      if (element instanceof CallBehaviorAction) {
         for (Object e : values) {
            if (e instanceof Token) {
               Value token = ((Token) e).getValue();
               if (token != null)
               System.out.println( "Tokenvalue:" + token);

In the code above I managed to retrieve the token values, what is missing is the corresponding argument name in order to know which parameter of the CallBehaviorAction belongs to which token value.

Thank you very much