VP ontoUML plugin: how-to add <<relator>> class to <<material>> relation - plugins

Using Visual Pradigm v17, OpenJDK v11.0.10, OntoUML plugin 0.5.3 on MacOS 10.16:
I'd like to use the relator class in my model. I cannot find a way to manually connect the relator class to the material relation that it is supposed to specify.
I tried to draw a connection, just like e.g. a specialisation or association relation, from the relator class to the material relation. I tried several different options of those that are being presented, but without success.

After muddling with this over an extended period, I feel stupid to see the solution to this.
Add an association class duh by right-clicking the canvas and selecting Add Shape > Association Class
Select the mediation relation that it should specify.
Done
I can't believe that I missed this obvious way forward

Related

How to inherit attributes in class/block diagram using Eclipse Papyrus?

I'm creating a very simple class diagram using the Eclipse Papyrus but I'm not able to represent instances correctly.
First of all, I'm using the SysML 1.6 profile, so my classes are actually represented in a Block Diagram instead of classes, but I believe that this does not change anything in my problem.
After creating a simple class/block in my block definition diagram (bdd) I defined some attributes for my block like the example below:
When I tried to create some instances of my block ("parts" in SysML naming convention) using an "Instance Specification" I'm not able to inherit these attributes and fill them with actual information like the "name" and "quantity" in this example.
It's possible to see that my classifier is correctly set as "My component".
The Papyrus documentation for the Object diagram is clear and says that these Instance Specification should include my attributes so I don't know what I'm doing wrong.
I've tried since now:
Create instances in the same block diagram (bdd);
Create instances in another dedicated diagram of the type internal block definition (ibd);
Use the Papyrus context menu to show/hide all my compartments. Any of them works to show my attributes.
Apparently, the same problem occurs without any SysML profile and using pure UML like this question here (from 2016!!)
Papyrus version: 6.1.0

Enterprise Architect: Change diagram type (MetaType) by script

i have to change the diagram type of a lot of diagrams within my Enterprise Architect model. The change can be made manually using following option (that works as expected):
Select diagram - Diagram - Advanced - Change Type...
As I have to change a lot of diagrams I have created a script which searches for all concerned diagrams and change the type automatically. I wrote already a lot of JScript EA scripts for changing some modeling elements. Unfortunately, this feature seems not be available over the scripting interface.
I have to change the "MetaType" of the the diagram object. But this is read-only (see http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/diagram2.html). Therefore, I got an error.
var currentDiagram as EA.Diagram
currentDiagram = theDiagram
currentDiagram.MetaType = MY_DIAGRAM_METATYPE // ERROR
In the next step I searched for appropriate functionalities in the Repository interface (http://www.sparxsystems.com/enterprise_architect_user_guide/12/automation_and_scripting/repository3.html) and in the project interface. But I found nothing appropiate.
I am using Enterprise Architect 12.0.1215 and I used JScript.
Has anyone already tried this by script?
Have I missed something?
Is there another approach to achieve the diagram type change by script?
Thanks in advance!
You have to do that in two steps (if you change to different MDG diagram types). E.g. to change a Class diagram to a BPMN2.0::BPEL you first change Diagram_Type from Logical to Analysis. Additionally you need to add MDGDgm=BPMN2.0::BPEL; to StyleEx. In case your old diagram is from another MDG you need to modify the existing MDGDgm attribute in StyleEx.
As Uffe noted, the diagram type in the API is r/o. So if you need to change that you would need to do something like
Repository.Execute("UPDATE t_diagram SET Diagram_Type='Analysis' WHERE Diagram_ID=<theId>")
where <theId> would be the correct diagram ID.

ELKI: Implementing a custom ResultHandler

I need to implement a custom ResultHandler but I am confused about how to actually integrate my custom class into the software package.
I have read this: http://elki.dbs.ifi.lmu.de/wiki/HowTo/InvokingELKIFromJava but my question is how are you meant to implement a custom result handler such that it shows up in the GUI?
The only way I can think of doing it is by extracting the elki.jar package and manually inserting my custom class into the source code, and then re-jarring the package. However I am fairly sure this is not the way it is meant to be done.
Also, in my resulthandler I need to output all the rows to a single text file with the cluster that each row belongs to displayed. How tips on how I can achieve this?
There are two questions in here.
in order to make your class instantiable by the UIs (both MiniGUI and command line), the classes must implement our Parameterization API. There are essentially two choices to make your class instantiable:
Add a public constructor without parameters (the UI won't know how to set your parameters!)
Add an inner static class Parameterizer that handles parameterization
in order to add your class to autocompletion (dropdown menu), the classes must be discovered by the MiniGUI/CLI/other UIs. ELKI uses two methods of discovery:
for .jar files, it reads the META-INF/elki/interfacename service files. This is a classic service-loader approach; except that we also allow ordering instances.
for directories only, ELKI will also scan for all .class files, and inspect them. This is mostly meant for development time, to avoid having to update the service files all the time. For performance reasons, we do not inspect the contents of .jar files; these are expected to use service files.
You do not need your class to be in the dropdown menu - you can always type the full class name. If this does not work, adding the name to the service file will not help either, but ELKI can either not find the class at all, or cannot instantiate it.
There is also a tutorial on implementing a custom result handler, but it does not discuss how to add it to the menu. In "development mode" - when having a folder with .class files - it will show up automatically.

Changing association type to aggregation results in diamond symbol on wrong side

In Enterprise Architect (EA) 9.3 I do the following on a UML class diagram:
Select an Association link between two classes
Right-click and choose Advanced / Change Type from context menu
Change type from Association to Aggregation and click OK
What I find is that the diamond symbol for an aggregation is drawn on the wrong side (the destination side).
Is this a known bug? Is there a easy workaround? Thanks.
In enterprise architect the lines are drawn from part to whole, so source is without the diamond.
If you want to change it:
Go to Tools-> Options -> Links
And set the "Draw Aggregations Reversed" Option
Don't change an Association to an Aggregation. Instead, open the Association's properties and go to either the Source Role or Target Role page and set the "Aggregation" value to "shared" or "composite".

How can I have two editors for the same property on a switch?

I am trying to create an editor where the user can either select an existing item or create a new one inline. For example, imagine the typical person-address relationship. I want a form where the user, when editing a person, can either select an address from a set of existing addresses or create a new address without moving to a separate form.
Naively, this seems to require two different editors for the same property. Say I have a Person which has Address getAddress() and setAddress(Address). My PersonEditor class would need to have two sub-editors named address of differing types; one to select an existing person and the another a composite of editors to descend into the Address type and allow editing of its properties.
From reading the documentation on CompositeEditor, it seems like I have to make use of it to dynamically select the sub-editor. However, the documentation isn't detailed enough for me to really understand how I should implement the interface. I've tried looking at how ListEditor and OptionalFieldEditor are implemented for clues, but to avail. ListEditor doesn't seem like a straight fit as my sub-editors edit different paths.
For instance, trying to use CompositeEditor, I'm unclear on what createEditorForTraversal and getPathElement should return in my case.
How do I dynamically attach one of two different types of editors to one property?
I managed to do this in the end. I simply added two editors with the same #Path annotation. I was not expecting the editor framework to allow this, but it seems to work!