Modelio icon indicating copy to clipboard operation
Modelio copied to clipboard

How to assign default values to parameters of an operation?

Open bobhairgrove opened this issue 2 years ago • 6 comments

When I create an operation, I can add parameters and adjust their properties. However, there isn't an obvious way to assign a default value, for example to a Boolean type parameter which should have a default value of false.

How to do it?

bobhairgrove avatar Jul 22 '23 09:07 bobhairgrove

Hello, To set default types, go to configuration - preferences - Project default values Under Operation you can find Parameters default type.

image

Regards, Irina

IrinaNeculita avatar Jul 24 '23 08:07 IrinaNeculita

@IrinaNeculita Thank you, but my question is slightly different:

I need to state a default VALUE for a parameter of a specific operation, not the default TYPE for ALL parameters.

Please reopen this question as it is not solved.

bobhairgrove avatar Jul 24 '23 09:07 bobhairgrove

When we create a parameter
from explorer : in property view - we have the default value - there you can set the value in diagram : operation edition view - add the parameter and on the column value can add the value you want. Let me know if this is the information you look for.

modelio_5EljawDKK1

regards, Irina

IrinaNeculita avatar Jul 24 '23 09:07 IrinaNeculita

Thank you, now I was able to set the default value in the tree view.

Next question: How to get this to show on the class diagram? For example, I have this text shown in the Operations pane of the class:

+beginParse(in encoding: string, in is_endian_be: boolean)
+endParse()
(etc.)

I would like to see this:

+beginParse(in encoding: string, in is_endian_be: boolean = false)
+endParse()

Thanks!

bobhairgrove avatar Jul 24 '23 11:07 bobhairgrove

I am using Modelio 5.3 on Linux Ubuntu 22.04. The "Edit Operation" dialog does not show any column headers for the parameter attributes, as your example has them.

Here is a screenshot of what I see: modelio_edit_operation_dialog

bobhairgrove avatar Jul 24 '23 11:07 bobhairgrove

For now is not possible to display the value of a parameter in diagram. I will send the request to development team.

Thank you for reporting the problem from operation edition window.

Irina.

IrinaNeculita avatar Jul 24 '23 13:07 IrinaNeculita