Operation with parameters

Moderator: Moderators

Operation with parameters

Postby audun@resser.no » Fri Mar 18, 2016 8:17 am

Hi!

I have problems figuring out how to send parameters with operation call actions in activity diagrams. I have created a simulation setup that executes nicely without parameters in the operations, but when I add the parameters, I’m not able to get it working.
The setup consists of a simulator with two parts, the system which is under test, and a stub that simulates the environment:
Simulator_Overiew.png

In the “ISystemData” interface there is an operation “setSystemData” that I want to send a parameter together with. In the activity diagram handling the call operation action, it is modeled as follows:
Calling_Operation.png

After the “addStructuralFeatureAction” the simulation is crashing. Anyone that can help?

I have attached both the a functioning simulation without parameters in the operation and the non-working with parameter in the operation.

Best regards
Audun
You do not have the required permissions to view the files attached to this post.
audun@resser.no
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Fri Mar 18, 2016 7:32 am

Re: Operation with parameters

Postby arnon_l » Mon Mar 21, 2016 4:43 am

Hello,

Your execution has been aborted because it tried to offer the withdrawn token.
The token of the output pin can be offered once, then it will be withdrawn.

Please use Fork after the output pin, it will create the new copy token.

a1.jpg


I hope this helps.

Best regards,
You do not have the required permissions to view the files attached to this post.
arnon_l
Customer Support
Customer Support
 
Posts: 79
Posts Rating:9
Joined: Thu Aug 30, 2012 3:39 am

Re: Operation with parameters

Postby audun@resser.no » Mon Mar 21, 2016 7:36 am

Thank you, that got it one step further. :)

Now it stops when entering the "UpdateResult" acitivity with the error message:
"WARN : Missing input parameter value for Activity UpdateResult. "
UpdateResult.png


Should the parameter be read in a different way?

Best regards
Audun
You do not have the required permissions to view the files attached to this post.
audun@resser.no
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Fri Mar 18, 2016 7:32 am

Re: Operation with parameters

Postby arnon_l » Mon Mar 21, 2016 6:50 pm

Audun,

"UpdateResult" was called by Effect of the transition.
For now, the only way to pass the parameters to Effect behavior is to use SignalEvent with its attributes.
If the attributes of the signal match with the parameters of the Effect behavior, values will be passed.

There is no way for CallEvent, we don't support that.

However, I don't understand why you want to add the "result" value, because it is bound to the textfield in you UI.
the value will be updated automatically when it is changed in the textfield.

Best regards,
arnon_l
Customer Support
Customer Support
 
Posts: 79
Posts Rating:9
Joined: Thu Aug 30, 2012 3:39 am

Re: Operation with parameters

Postby audun@resser.no » Tue Mar 22, 2016 4:01 am

Hi!

This is just an example projects to learn the mechanisms of the simulation toolkit, the text-fields are only used to display the value of the value properties in the UI, instead of having to navigate the variables in the simulation console.

In a "real" case, the parameter of the operation is very likely to be a nested datatype, so that more than a single value is transferred with the operation.

To simulate our models, the capability of simulating operations with parameters is a must have, do you plan to support that in the future?

Best regards,
audun@resser.no
Forum Newbie
Forum Newbie
 
Posts: 3
Posts Rating:0
Joined: Fri Mar 18, 2016 7:32 am

Re: Operation with parameters

Postby arnon_l » Wed Mar 23, 2016 7:30 pm

Audun,

We supports the capability of simulating operations with parameters, you can do via:
- CallBehaviorAction in Activity (you did in your model)
- ALH.callOperation(Object_ object, String name, List<?> arguments, boolean isSynchonous) in any scripts (see at "manual/Cameo Simulation Toolkit API UserGuide.pdf")
- SignalEvent in StateMachine (signal attributes must match with operation parameters)

However, we have not supported to call operations with parameters via CallEvent in StateMachine as you did.
We will record this issue to our list for the future improvement.

For now, please use workarounds that we have.
We apologize for any inconvenience this issue may cause.

Best regards,
arnon_l
Customer Support
Customer Support
 
Posts: 79
Posts Rating:9
Joined: Thu Aug 30, 2012 3:39 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests