Book a Demo

Author Topic: Why can't I set the Signal values in a SendSignal action?  (Read 5399 times)

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Why can't I set the Signal values in a SendSignal action?
« on: November 06, 2024, 09:51:07 pm »
I have an activity diagram with a Send Signal action (in SysML 1.5). The signal has an attribute "value". When I go to the properties for the action, I have to go to the "condition" tab to select the signal, and then set the attribute to a value. The problem is that the Save button is greyed out. So any changes I make to the signal attribute are lost when I click elsewhere in the diagram. Why can't I save my changes?

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Why can't I set the Signal values in a SendSignal action?
« Reply #1 on: November 06, 2024, 10:09:53 pm »
I don't know if it is a EA bug or not, but it seems that through the properties dialog, it is impossible to set signal parameter values for the Send Signal action.

If I put this line in the effects field however, I get what I want:

Code: [Select]
UIBroadcastSignal("TestResult",{'val':1});
This will broadcast the signal TestResult with a value of 1, and cause the state machine to transition to the next state. I cannot set this in the UI, I have to go through some effects code. That is a problem then in the properties for the Send Signal in EA.

This post helped me out by the way, and that is why I am suspecting a bug.

https://sparxsystems.com/forums/smf/index.php/topic,48028.0.html

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: Why can't I set the Signal values in a SendSignal action?
« Reply #2 on: November 07, 2024, 10:18:29 am »
To save the value , you need to add an ActionPin to the SendSignal action. This is because each parameter is connected to an Action Pin.

But as far as I tried, I cannot get the set value in the AcceptEventAction. I am afraid that we cannot pass parameters of a Signal without using the UIBroadcastSignal.
--
t-kouno

mse

  • EA User
  • **
  • Posts: 308
  • Karma: +1/-0
    • View Profile
Re: Why can't I set the Signal values in a SendSignal action?
« Reply #3 on: November 07, 2024, 07:38:24 pm »
I got it to save after adding an ActionPin, but I had to add the ActionPin a second time, then delete, and then repeat, and then the setting stayed. It is very strange behavior. I think I know why after trial and error however. You have to select the ActionPin first that you would like to assign signal information to:

1. Select ActionPin
2. Select Signal
3. Set the Signal parameter and value
4. Click on save.

If we cannot pass parameters then I guess it's of no use setting the ActionPin. I will just have to use UIBroadcastSignal as you recommended. The activity is called form the state machine but the signal parameter does not seem to be interpreted in the trigger guard. If I remove the guard from the state transition, then the signal is received and the transition is taken.
« Last Edit: November 07, 2024, 09:08:58 pm by mse »