Passing a parameter to a transition with a operation

Discussions about database modeling product Cameo Data Modeler functionalities

Moderator: Moderators

Passing a parameter to a transition with a operation

Postby redgatornm » Fri May 21, 2021 12:35 pm

I have a simple model Cameo 19 Sp2 that triggers a transition on a second object state machine using an operation and a callevent.

When I add a parameter to the operation, the operation no longer triggers the transition.

I'm trying to emulate a bus operation, with a parameterized event that might trigger a specific recipient and not others.

I'm probably just making too much use of my white cane...
redgatornm
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon May 17, 2021 12:28 pm

Re: Passing a parameter to a transition with a operation

Postby saulius_p » Fri May 21, 2021 12:48 pm

Hello,

Good to talk to you! Could you attach small sample and indicate what you execute and what is not working?

Sincerely,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 354
Posts Rating:15
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: Passing a parameter to a transition with a operation

Postby redgatornm » Sun May 23, 2021 8:31 am

First, thank you.

I've love to, but my Cameo is behind a firewall and it is almost impossible to export anything. On top of that, anything I build or import gets polluted with corporate proprietary stuff I couldn't share if I wanted to.

However, it's not hard to demonstrate. In fact, I started with SignalEvent and moved on to try CallEvent, and both demonstrate this behavior, so I'll go back to SignalEvent.

Take the sample simulation "FlashingLight.mdzip". Add an attribute to the "start" signal. I generally add an Integer attribute with the name "slot" and a default value of 23.

The simulation will no longer operate, stalling at the point where the "start" signal should be triggering the transition in TImer from Off to Ticking.

If you remove the attribute, the simulation will then operate again. So the attribute is toxic. No errors, no nothing, and no operation.

If I understand the use of attributes, I should think I can decide to trigger on a signal if the attribute is matched. This would be the "bus" emulation: a signal "command" sent to a number of blocks which will only trigger certain blocks.

It's like the logic is "if signal happens and the signal has no attributes then trigger" and "if the signal happens and the signal has attributes and we don't know how to deal with the attributes, don't trigger". I don't find this behavior described in the documentation. Neither do I find an example that shows how to make use of attributes.

Modified to use a CallEvent, if you have no Parameter on the Operation, the simulation operates. If you add a Parameter to the Operation, the simulation stalls at the CallEvent with the Parameter defined (but not otherwise used).

And no errors produced in either case (as far as I've been able to tell).

They've promised training, but the training is not soon or certain, and they are expecting us to make use of this tool.
redgatornm
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon May 17, 2021 12:28 pm

Re: Passing a parameter to a transition with a operation

Postby saulius_p » Mon May 24, 2021 12:44 pm

Hello,

Please find working flashlight sample with signal parameter and video attached.

Here are also videos displaying other attached samples:
https://youtu.be/h5ZAXb07-Fs
https://youtu.be/Cwz_tuKX_xs
https://youtu.be/vcj5xIfrORk

Let us know if you have any more questions or issues.

Kind regards,
Saulius
You do not have the required permissions to view the files attached to this post.
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 354
Posts Rating:15
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis

Re: Passing a parameter to a transition with a operation

Postby redgatornm » Tue May 25, 2021 7:17 am

Most excellent! I will post back when I've had a chance to work through these...

Update: Using "flashlight with parameter" as the exemplar - OK, my simpler-than-flashlight CallEvent case actually continues past the parameter definition now by adding an opaque action to define the value. That's very interesting how a defined parameter with an undefined value makes a CallEvent no longer a functioning CallEvent.

Update: OK, my simpler-than-flashlight SignalEvent case actually continues past the attribute definition now by adding an opaque action to define the value. A default value defined is not adequate to make the SignalEvent a valid SignalEvent, there must be an opaque action (or, I would hope, some other information source to define "slot") to make the SignalEvent trigger the transition.

I think I attempted to use an OpaqueAction before, but did not populate the Body (tried something, not remembering now...) and it had no effect...

Update: it is only necessary to define an OpaqueAction with an output pin and attach it to the SendSignalAction input pin; nothing has to be defined inside the OpaqueAction for the signal to trigger the transition.

Examining "send signal with property 2", you used a ValueSpecificationAction to feed a value to the SendSignalAction. THIS is what I attempted to use and could not remember. However, it did not work for me...

And I attempt to apply the ValueSpecificationAction in the place of the OpaqueAction, and it lies there like a dead fish... the only difference is that I'm sending the signal over a Port and your example does not.

This is feeling like playing a game of FizzBin... is it Tuesday yet? https://memory-alpha.fandom.com/wiki/Fizzbin

It's a ROYAL FIZZBIN! Apparently trying things leaves little turds around that quietly make the simulation stall. Kinda like leaving a semicolon out. Sometimes. I cleaned up the turds, and I now have a flashlight simulation where I have BOTH a ValueSpecificationAction and an QpaqueAction in the same activity - and I can connect either one to the SendSignalAction and the simulation will run...

Yeah! https://docs.nomagic.com/display/CST202 ... ripts+APIs ALH.getvalue($signal$, "value") - get the value "value" from "The last signal Instance in an Event pool of a specified object." - not clear how the object has been "specified" - is this a contextual thing?

BEST AND FINAL - WOOPIE! And now I've cranked what you've taught me back into my IPMI bus model addressing multiple blocks with a single parameterized signal and only the addressed block is responding.

Guard on Transition: ALH.getValue($signal$, "slot") == 9 && ALH.getValue($signal$, "command") == "activate"

Now I have to learn how to create classes and parameterize model components - which is what I think you've provided in the third example "sending signal with multiple parameters"...

Thank you very much!

labai ačiū!
redgatornm
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Mon May 17, 2021 12:28 pm

Re: Passing a parameter to a transition with a operation

Postby saulius_p » Tue May 25, 2021 12:25 pm

Hello,

Thank you for the feedback. Sorry for the challenges you see. We do have Simulation 5 days training which would be very very helpful but it is for 12 people class. Let us know if this is of interest.

Between there is good samples on parametric diagram in samples provided with tool and online at:

https://youtu.be/uLaKUOlgDjU
https://youtu.be/NPRqmScSYTA
https://youtu.be/z9g6WxwX-mY

and more in MBSE Execution channel on Youtube.

Sincerely,
Saulius
Best regards,
Saulius Pavalkis
User avatar
saulius_p
No Magic
No Magic
 
Posts: 354
Posts Rating:15
Joined: Fri Dec 04, 2009 5:37 am
Full name: Saulius Pavalkis


Return to Cameo Data Modeler

Who is online

Users browsing this forum: No registered users and 0 guests