Bug 528270 - Missing variables and strange behavier with Decorations
Summary: Missing variables and strange behavier with Decorations
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.1.0   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-12-07 09:48 EST by Stéphane Thibaudeau CLA
Modified: 2017-12-08 09:42 EST (History)
2 users (show)

See Also:


Attachments
decoration VSP and Sample (4.97 KB, application/octet-stream)
2017-12-08 09:42 EST, Laurent Fasani CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stéphane Thibaudeau CLA 2017-12-07 09:48:08 EST
I encountered 2 problems with decorations :

1) "Image expression" can use only 3 variables ("container", "containerView" and "diagram").
We miss variables on the element we're decorating like "element" and "view" variables".
Fortunately, self points to the semantic in the context.

2) When there is an error within the expression, no exception is visible in Error log view despite a call to RuntimeLoggerManager.INSTANCE.error() in DescribedDecorationDescriptorProvider and "Image not found" is displayed on the diagram.
Comment 1 Stéphane Thibaudeau CLA 2017-12-07 11:51:42 EST
If I may add something, I think that the default behavior should be that if the image expression evaluates to null or empty string then no decorator should be created. As for now, we have a "Not found image" in this case.
Comment 2 Laurent Redor CLA 2017-12-08 08:19:23 EST
> 1) "Image expression" can use only 3 variables ("container", "containerView"
> and "diagram").
> We miss variables on the element we're decorating like "element" and "view"
> variables".
> Fortunately, self points to the semantic in the context.

Technical information: This points seems to be like bug 522193 for precondition expression.
Comment 3 Laurent Fasani CLA 2017-12-08 09:39:44 EST
Scenario1:
* import both vsp and sample projects
* open the diagram
-> image not found in SOUTH_WEST.(It is normal because element variable that is used does not exists as variable). BUT, at least a message should be logged in the error log view
-> image not found in NORTH_WEST.(It is normal because the expression returns null). Feature request: in that case, there should not be any decoration


Scenario2:
* open decoration.odesign
* select a decorationDescription
* hover the image Expression tooltip
-> element and view variables should be available.
Comment 4 Laurent Fasani CLA 2017-12-08 09:42:19 EST
Created attachment 271832 [details]
decoration VSP and Sample