Issue with string comparison in helper... [message #1817672] |
Wed, 27 November 2019 11:51  |
Eclipse User |
|
|
|
Hello,
Using ATL 4.1.0 installed on Eclipse 2019-09.
I found out that the following helpers always return false, regardless of whether the qualified name of the UML type received from context equals the constant string hardcoded in the helper (as verified using debug statements, which also prove the helper is triggered, while traces in the caller show the returned value is always false):
-- Check for high level SysML UML stereotypes
helper context UML!Element def: isSysMLBlockStereotyped() : Boolean =
self.getAppliedStereotypes()->exists(s | let qn : String = s.getQualifiedName() in (qn.debug('STEREOTYPE') = 'SysML::Blocks::Block'));
--self.getAppliedStereotypes()->exists(s | s.getQualifiedName() = 'SysML::Blocks::Block');
helper context UML!Element def: isSysMLConstraintBlockStereotyped() : Boolean =
self.getAppliedStereotypes()->exists(s | s.getQualifiedName() = 'SysML::Constraints::ConstraintBlock');
helper context UML!Element def: isSysMLPortStereotyped() : Boolean =
self.getAppliedStereotypes()->exists(s |
let qn : String = s.getQualifiedName() in (
(qn = 'SysML::PortAndFlows::FlowPort') or
(qn = 'SysML::DeprecatedElements::FlowPort') or
(qn = 'SysML::PortAndFlows::FullPort') or
(qn = 'SysML::PortAndFlows::ProxyPort'))
);
helper context UML!DataType def: isValueTypeStereotyped() : Boolean =
self.getAppliedStereotypes()->exists(s | s.getQualifiedName() = 'SysML::Blocks::ValueType');
Isn't this a valid way to test for stereotypes with ATL?
Thanks,
-- OHM.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.24605 seconds