Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jacob Vos

Pages: 1 [2] 3 4 ... 6
16
Is there a way to set a fill color in a shapescript, but still allow users to change the fill color in a diagram?

This is my shapescript:

Code: [Select]
shape main

{
setfillcolor(255,128,128);
rectangle(0, 0, 100, 100);
    addsubshape("typecompartment", 100, 20);
addsubshape("namecompartment", 100, 20);
    addsubshape("notescompartment", 100, 60);

shape typecompartment
{
h_align = "center";
v_align = "center";
bold = "true";
rectangle(0, 0, 100, 100);
print("Datavalidatieregel #TAG:ConstraintID#");
}

shape namecompartment
    {
h_align = "center";
v_align = "center";
editableField = "name";
rectangle(0, 0, 100, 100);
printwrapped("#name#");
     }

    shape notescompartment
    {
h_align = "left";
editableField = "note";
println("");
printwrapped("{#notes#}");
    }
}

17
@Eve: Thank! Found it. Strange: the XML-file contains my 'lost' query, and has another query with exactly the same name (but other GUID).

18
General Board / Re: Wrap contents of memo fields in search results
« on: April 06, 2020, 04:39:25 pm »
@Eve: It looks like this is a limited solution, because only one field can have 'as Note', and also the name of the notes field cannot be specified (e.g. the Dutch word 'Opmerkingen'). And because the query joins some elements, how to tell which element's notes are shown of no specific label can be provided?



19
I lost a SQL query that was stored in 'My Searches'. There is a database backup, but: in which table are 'My Searches' stored? Going through the tables, I didn't find one with a name that would let me think about stored searches. Or are my searches stored elsewhere?

20
I tested two ways to define a custom (own stereotyped) constraint in a profile: as extension of Constraint and as extension of Class. I prefer the last one, but am interested to hear others' opinions.

Reasons why I prefer custom constraints as extension of Class:
1. The constraints are shown in the project browser.
2. Autocounter / naming can be applied.
3. In a relationship matrix, the constraints can be set as as context item (with the build-in Constraint metaclass, there is a bug with this).
4. I prefer the properties window that is opened above the one for the build-in Constraint metaclass.

21
General Board / Re: Wrap contents of memo fields in search results
« on: April 03, 2020, 09:19:54 pm »
Alas Geert, no wrapping of long text there neither. But thank you for pointing me to placing Model Views on diagrams. (Bad point: SQL there 'lives' apart from the SQL in 'My Searches'...)

22
And the solution was... upgrading from build 1514 to build 1528...

@Eve: I implemented already the metaconstraint you proposed. So it didn't work in build 1514 but in 1528.

@Rupertkiwi: thank you for sharing the link. That is indeed a very good addition to the Sparx helptext about defining profiles. (But not for the question I had now.)

23
General Board / Wrap contents of memo fields in search results
« on: April 02, 2020, 01:51:15 am »
I defined a search with some memo fields as output. Is there a way to wrap the contents of those fields in the search results?

If not: which are the possiblities to get elsewhere in Sparx EA a table-like view of constraints, preferably the result of a query search (in order to have some columns in the table that contain contents of tagged values)?

24
Found! Adding a Tagged Value Type (in this case with in the Detail field 'Type=Memo;') and adding an attribute to the custom element with exactly the same name as the Tagged Value Type. No type has to be filled in at the attribute.

25
To a custom  (= stereotyped) element in a profile, I want to add an attribute that can hold a lot of text ('memo', so more than 255 characters). I tried to do this by setting the attribute's type to 'Memo', but that offered no solution.

26
I did now and will publish the result here.

Jacob

27
Hi Geert,

Adding the metaclass 'Class' and setting the metaconstraint to it doesn't lead to any restriction (I had tried that already).

Extending that metaclass 'Class' with a stereotype with the name "UML::Class" and setting the metaconstraint to that stereotype, makes it impossible to draw the connector having as target an element of type Class (that is not stereotyped: it's the 'general' Sparx EA class element).

I even tried setting no name for the stereotype (so remove "UML::Class") with no result - but it would be strange and rather a bug if this had worked.

Lastly, applying a 'stereotyped relationship' is also not the solution.

Jacob

28
Ah, my problem was in fact not that setting (it was already there), but wrong definition of the metaconstraint with umlrole = target.

Still I have something to solve:
- I defined a custom (stereotyped) connector and a custom element.
- I set the custom element as the only allowed source for the connector.
- Now I want to set the metaclass 'Class' as the only allowed target for the connector.

I wonder whether this is possible. The help text seems to tell that only custom elements can be used to set metaconstraints to.

29
In this way, the constraint is checked at the moment of model validation. I would like to implement checking at the moment the connector is drawn. Is that possible, too?

30
In a custom MDG, I defined own connectors. Is there a way to indicate that the connector may only have elements of type X as source (in my situation a customized element of metaclass Constraint) and elements of type Y (in my situation Class) as destination? I couldn't find this in the Special Attributes that can be set at a stereotyped model element.

Pages: 1 [2] 3 4 ... 6