What is the semantics of UML's ReadVariableAction in BoUML? - uml

ReadVariableAction activity action in BoUML allows to choose a class and its attribute and returns the attribute through creation of output pin (see figure below and BoUML documentation):
But what is the semantic of that action? What does ReadVariableAction operation actually return?
According to clause 16.9.3.1 Variable Action of The Unified Modeling Language Specification Version 2.5:
A VariableAction operates on a statically-specified Variable. The Variable must be one that is defined either by an Activity (see sub clause 15.2) or a StructuredActivityNode (see sub clause 16.11) containing the VariableAction.
Clause 15.2.2 Abstract Syntax below says that Variable subsets ownedMember, so the variable should be identifiable by name.
But BoUML neither allows creation of variables for an activity nor passing a name of a variable to ReadVariableAction.
It seems that I could use ReadVariableAction as shown below
But it's wrong model from UML's point of view.

The semantic of the read/write/clear/add/remove variable actions in BoUML is ... wrong !
Clearly I misunderstood that part when I added the activities in BoUML, I didn't read well the norm to understood that concerns variable of the activity or a structured activity node. So by error the 'variable' I allow to choose is an attribute of a class. An other consequence is you cannot define variables for an activity nor structured activity node.
Mea culpa
BoUML 7.10 is available and fix the problem

Related

How to draw the UML diagram which representing invocations between methods in the same class inheritance tree? [duplicate]

I have a child class which wants to add more functionality to a base class function, how can I represent that it also does the base class function not just the newly added functionality?
Interesting question. I tried that with Enterprise Architect. It did let me select the parent's operation but the display in the diagram did not change. It seems like you need to use notes for that:
As you can see Class2 inherits from Class1. The SD shows a call to Class2's operation a(). The call to the super-class's Class1.a() as internal call shows the same signature. A note clarifies the situation.
Maybe there's something else possible with this. But that's what I came up with immediately.
P.S. I've looked up the specs. P. 575 of UML 2.5 says
The message-name appearing in a request-message-label is the name property of the Message. If the Message has a signature, this will be the name of the Operation or Signal referenced by the signature. Otherwise the name is unconstrained.
That would put in the option to specify the operation in question as Class1:a() or the like. Actually Enterprise Architect shows it that way in the properties of the message but shortens it to just the basic name. Just a border case, I'd guess.

How to automatically bind template types in Enterprise Architect when a class is realizing a generic interface

I have defined a generic interface using Enterprise Architect (see figure below).
I would now like to specify the following realization:
class AircraftsTypesRepository implements Repository<AircraftTypes, Integer>
Is there a way for EA to automatically bind types and method signatures to the generic types I specified in the base interface. In other words, I would like to show in the diagram that for the AircraftTypesRepository class, T and K and bound to T=AircraftTypes, and K=Integer. I would also like to see this reflected in the interface methods
I thought about this and (as there's no native support) would suggest to script that. There are plenty of ways, so I'd take a KISS one. The Realize relation could be adorned with tagged values named Bind<val> or so where <val> is the name of a template parameter (in your example T or K). These TVs should then be defined as RefGUID which allows them to link to an EA element. Creating these TVs should be one script which looks into the templated class. You find the template definition in the table t_xref with
SELECT description FROM t_xref
WHERE client = `<GUID of element>` AND type = `elment property`
This will contain something like
#ELEMENT;GUID={5EC3D8DF-BC37-4529-8F36-0D9BA363955D};Name=E;Type=ClassifierTemplateParameter;Pos=0;#ENDELEMENT;;
(I created an example with just T but you will decode it easily, I guess.)
Now that you have the tagged value(s) set in the Realize you can run a second script to synch the definition ("just" look for textually identical types). Later you could alter the TVs and re-synch again (AFAIK there's not hook for TVs being altered so that needs to be triggered manually).
This is not a complete solution but just a suggestion which leaves open quite some field for experimentation (and failure).

How to specify the return type of a method that returns a list of values in StarUML?

I have two classes (say Database and Record). In Database class, I have a method named getRecords() that returns a list of Record objects.
In Java, the above method can be written as:
List<Record> getRecords(){..}
In StarUML, while designing Class diagram, I tried giving
+getRecords() : Record[0..*]
But StarUML refused to create method like above. When I tried with the one below, it works
+getRecords() : ArrayList<Record>
But this is more specific to Java. I want to implement something like Record[0..*] in StarUML. Is it possible to write methods in such format or the Java style of return type is the only solution ?
I don't know why StarUML refuses to parse the text, but you can still create it via model.
Add the operation and call it getRecords()
Right-click on the operation (in diagram or model), and select Add > Parameter
Select parameter in Model Explorer (probably the parameter is already selected when you created it) and set the direction parameter to return. This is how UML represents return types.
(Configure the type, multiplicity, and anything else you need.)
Note that the default collection in UML is Set, so you should check isOrdered, as List is an ordered collection.

How to specifiy enumeration literal as default value in UML Attribute?

I currently doing some model transformations using EMF-UML-Implementation.
In my model transformation I create an uml class with some attributes. The attributes are type of enumerations I also created.
Some of the attribute should get a default value. The default value should be enumeration literals.
The question now is, how do I get the enumeration literals to the defaultValue-property of the Property.
I already have found that I have to use ValueSpecification. But the UML superstructure says not much about that (page 139 f.). Which properties do I have to use for setting the defaultValue to enumeration literals?
I think the main problem I have is, that the use of ValueSpecification is unclear to me. Currently I only use default to set the default values, which is type of String.
The defaultValue-property takes a ValueSpecification argument. So in your case, you need an InstanceValue for this purpose (which derives from ValueSpecification). The InstanceValue itself has an instance-property, which takes an InstanceSpecification as argument. As EnumerationLiteral derives from InstanceSpecification, you can now simply assign one of your EnumerationLiterals to it.

CMIS query language; Queryname cmis:document

I have some problems with CMIS query language. I want to get all documents (table no important), which have some property. So I wrote Select my_property from cmis:document.
Unfortunately I get answer: 0 documents. But when I alter query to Select my_property from my_table. I get different answer.
Could you tell me why?
The reason is that the spec does not provide for it. Here is what the spec says about the "relational view projection" (source):
In each Virtual Table, a Virtual Column is implicitly defined for each
property defined in the Object-Type Definition AND for all properties
defined on ANY ancestor-type of the Object-Type but NOT defined in the
Object-Type definition.
So a given object-type can be queried for properties of ancestor types, but the spec makes no provision for querying an object-type for properties of descendent types, which is what you are trying to do.
Jeff

Resources