Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [papyrus-rt-dev] Replication factors for capsule parts and ports

Thanks Peter. I was aware of the plans to use "Replication", but I wasn't aware that legacy models could provide it as a string.

Currently the code generator obtains the multiplicity from the port, part or any property via the org.eclipse.uml2.uml.Property.lowerBound and org.eclipse.uml2.uml.Property.upperBound and both return an int, so that limits the user by allowing only LiteralInteger and LiteralUnlimitedNatural.

I do not know how the tooling populates the relevant features in the model.

To support LiteralStrings, one possibility would be for us to get the ValueSpecification instead of the int (calling e.g. getUpperValue), and then either trying to resolve the symbol if the ValueSpecification is a LiteralString (which in the general case may not be possible), or (probably better) updating the intermediate meta-model to support such strings and adapting the part of the generator that emits type declarations accordingly. I think this is doable, so we could generate the corresponding array declarations with constants and then the user can create his own headers with constant definitions, or define them in any other way in which constants can be defined.

If the tooling adds a browse button and lets you select any constant, I'll expect the constant to be a ValueSpecification, and we would deal with it accordingly.

Would you mind opening a bugzilla with this issue, since the others are assigned to tooling?

Thanks







On Fri, Nov 20, 2015 at 10:45 AM, Peter Cigéhn <peter.cigehn@xxxxxxxxx> wrote:
Hi,

When I made some comments on a Bugzilla related to how replicated capsule parts (and also ports) shall have "stacked" notation in the capsule structure diagram, see


I realized that I am not sure what is (or planned to be) supported in the code generator.

As I have indicated in the two Bugzillas related to that we shall use the terminology "Replication factor" and "Replication" (instead of multiplicity)


the replication shall be possible to specify both as a numeric value as well as a string.

In legacy models you are allowed to specify the multiplicity in form of a string (specified with an OpaqueExpression, but I do know that it has been discussion about the use of OpaqueExpression and the import tool currently has the possibilty to make all OpaqueExpressions into LiteralStrings) where that string references, using the qualified name, of a constant defined somewhere in the model. 

In the legacy tooling there is even a "Browse..." button next to the multiplicity field (which as indicated above will be called replication in Papyrus-RT) where you can browse (or search) the model to locate the constant, and then the (text) field of multiplicity is automatically filled with the qualified name of the selected constant, i.e. an attribute owned by some class with a default value (and probably some settings that it is a constant).

So my question is if any such pattern is supported by the code generator, and whether we shall add such a browse button to the tooling or not? 

Or if there are some other plans how to support replication factors based on some constant either in the model, or even possibly in external header files which potentially could be shared with other external code to ensure that certain constants in some global headerfile *both* controls replication factors inside the model, as well as in external code. Or the possibility that replication factors are specified in transformation configuration files, so that when you build for different targets you build with different replication factors in the model.

/Peter Cigéhn

_______________________________________________
papyrus-rt-dev mailing list
papyrus-rt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/papyrus-rt-dev




--
Ernesto Posse
Zeligsoft.com


Back to the top