Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL query for UML association classes not working
OCL query for UML association classes not working [message #1403798] Sun, 27 July 2014 18:14 Go to next message
James Clark is currently offline James ClarkFriend
Messages: 9
Registered: July 2009
Junior Member
I’m working on a BIRT report on a Rational Software Architect (v9.0.0.1)
model that will show all of the UML classes, enumerations, and
association classes for a given class/freeform diagram. The report is
comprised of three tables with these three row queries, which take the
URI of the diagram as a parameter:

* oclEvaluate(resolveURI($diagramURI),
"self.children->select(c|c.element.oclIsKindOf(uml::Class))->collect(c|c.element)")
* oclEvaluate(resolveURI($diagramURI),
"self.children->select(c|c.element.oclIsKindOf(uml::Enumeration))->collect(c|c.element)")
* oclEvaluate(resolveURI($diagramURI),
"self.children->select(c|c.element.oclIsKindOf(uml::AssociationClass))->collect(c|c.element)")

My problem is that the last query for association classes is not
returning any present in my diagram. The first two queries work fine. Is
the OCL correct for association classes? I'm an OCL newbie.
Re: OCL query for UML association classes not working [message #1403804 is a reply to message #1403798] Sun, 27 July 2014 20:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Since you use "uml" rather than "UML", I presume you are using the old
Classic OCL in which the incorrect UML2Ecore conversion is effective.

The three different queries are very similar so I'm surprised that there
is a problem. AssociationClass is rare, did you mean Association?

Again since you are using "uml" rather than "UML", I presume you are
using UML.ecore rather UML.uml so you may have inappropriate UML2Ecore
conversion options that lose AssociationClass.

Without any models or versions, I can only guess. What is c ? Is element
appropriate? The final c.element looks very inefficient when you can
simplify to:

children.element->selectByKind(uml::AssociationClass)

Regards

Ed Willink


On 27/07/2014 19:14, James Clark wrote:
> I’m working on a BIRT report on a Rational Software Architect
> (v9.0.0.1) model that will show all of the UML classes, enumerations,
> and association classes for a given class/freeform diagram. The report
> is comprised of three tables with these three row queries, which take
> the URI of the diagram as a parameter:
>
> * oclEvaluate(resolveURI($diagramURI),
> "self.children->select(c|c.element.oclIsKindOf(uml::Class))->collect(c|c.element)")
> * oclEvaluate(resolveURI($diagramURI),
> "self.children->select(c|c.element.oclIsKindOf(uml::Enumeration))->collect(c|c.element)")
> * oclEvaluate(resolveURI($diagramURI),
> "self.children->select(c|c.element.oclIsKindOf(uml::AssociationClass))->collect(c|c.element)")
>
> My problem is that the last query for association classes is not
> returning any present in my diagram. The first two queries work fine.
> Is the OCL correct for association classes? I'm an OCL newbie.
Re: OCL query for UML association classes not working [message #1403805 is a reply to message #1403804] Sun, 27 July 2014 20:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Correction. RSA is not supported by Eclipse. Please contact IBM for
support on proprietary and often vintage versions of Eclipse OCL.

The v9 web pages suggest deviations from the Eclipse OCL I am familiar
with and give no indication as to what was packaged and what is modified.

Regards

Ed Willink

On 27/07/2014 21:21, Ed Willink wrote:
> Hi
>
> Since you use "uml" rather than "UML", I presume you are using the old
> Classic OCL in which the incorrect UML2Ecore conversion is effective.
>
> The three different queries are very similar so I'm surprised that
> there is a problem. AssociationClass is rare, did you mean Association?
>
> Again since you are using "uml" rather than "UML", I presume you are
> using UML.ecore rather UML.uml so you may have inappropriate UML2Ecore
> conversion options that lose AssociationClass.
>
> Without any models or versions, I can only guess. What is c ? Is
> element appropriate? The final c.element looks very inefficient when
> you can simplify to:
>
> children.element->selectByKind(uml::AssociationClass)
>
> Regards
>
> Ed Willink
>
>
> On 27/07/2014 19:14, James Clark wrote:
>> I’m working on a BIRT report on a Rational Software Architect
>> (v9.0.0.1) model that will show all of the UML classes, enumerations,
>> and association classes for a given class/freeform diagram. The
>> report is comprised of three tables with these three row queries,
>> which take the URI of the diagram as a parameter:
>>
>> * oclEvaluate(resolveURI($diagramURI),
>> "self.children->select(c|c.element.oclIsKindOf(uml::Class))->collect(c|c.element)")
>>
>> * oclEvaluate(resolveURI($diagramURI),
>> "self.children->select(c|c.element.oclIsKindOf(uml::Enumeration))->collect(c|c.element)")
>>
>> * oclEvaluate(resolveURI($diagramURI),
>> "self.children->select(c|c.element.oclIsKindOf(uml::AssociationClass))->collect(c|c.element)")
>>
>>
>> My problem is that the last query for association classes is not
>> returning any present in my diagram. The first two queries work fine.
>> Is the OCL correct for association classes? I'm an OCL newbie.
>
Re: OCL query for UML association classes not working [message #1403872 is a reply to message #1403805] Mon, 28 July 2014 10:56 Go to previous messageGo to next message
James Clark is currently offline James ClarkFriend
Messages: 9
Registered: July 2009
Junior Member
On 7/27/14 4:35 PM, Ed Willink wrote:
> Hi
>
> Correction. RSA is not supported by Eclipse. Please contact IBM for
> support on proprietary and often vintage versions of Eclipse OCL.
>
> The v9 web pages suggest deviations from the Eclipse OCL I am familiar
> with and give no indication as to what was packaged and what is modified.
>
> Regards
>
> Ed Willink
>
> On 27/07/2014 21:21, Ed Willink wrote:
>> Hi
>>
>> Since you use "uml" rather than "UML", I presume you are using the
>> old Classic OCL in which the incorrect UML2Ecore conversion is
>> effective.
>>
>> The three different queries are very similar so I'm surprised that
>> there is a problem. AssociationClass is rare, did you mean Association?
>>
>> Again since you are using "uml" rather than "UML", I presume you are
>> using UML.ecore rather UML.uml so you may have inappropriate
>> UML2Ecore conversion options that lose AssociationClass.
>>
>> Without any models or versions, I can only guess. What is c ? Is
>> element appropriate? The final c.element looks very inefficient when
>> you can simplify to:
>>
>> children.element->selectByKind(uml::AssociationClass)
>>
>> Regards
>>
>> Ed Willink
>>
>>
>> On 27/07/2014 19:14, James Clark wrote:
>>> I’m working on a BIRT report on a Rational Software Architect
>>> (v9.0.0.1) model that will show all of the UML classes,
>>> enumerations, and association classes for a given class/freeform
>>> diagram. The report is comprised of three tables with these three
>>> row queries, which take the URI of the diagram as a parameter:
>>>
>>> * oclEvaluate(resolveURI($diagramURI),
>>> "self.children->select(c|c.element.oclIsKindOf(uml::Class))->collect(c|c.element)")
>>>
>>> * oclEvaluate(resolveURI($diagramURI),
>>> "self.children->select(c|c.element.oclIsKindOf(uml::Enumeration))->collect(c|c.element)")
>>>
>>> * oclEvaluate(resolveURI($diagramURI),
>>> "self.children->select(c|c.element.oclIsKindOf(uml::AssociationClass))->collect(c|c.element)")
>>>
>>>
>>> My problem is that the last query for association classes is not
>>> returning any present in my diagram. The first two queries work
>>> fine. Is the OCL correct for association classes? I'm an OCL newbie.
>>
>
Thanks for your response. I've attached the RSA configuration log so you
could determine what flavor of OCL is being used. I do want association
classes. I don't know what "c" is in the expression. I took this from
the RSA Help
<http://pic.dhe.ibm.com/infocenter/rsahelp/v9/index.jsp?topic=%2Fcom.ibm.ccl.erf.doc%2Ftopics%2Ft_create_report_specifics.html>
suggestion. I appreciate the fact that these expressions could be
written more succinctly. So what would be the full expression with your
suggestion on the use of /selectByKind/?
Re: OCL query for UML association classes not working [message #1403878 is a reply to message #1403872] Mon, 28 July 2014 11:59 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Thanks for the detail. It's certainly a non-standard build.

org.eclipse.ocl (3.2.1.v20120917-1739) is a Juno service release.
(v201206 plus a bit)

org.eclipse.ocl.uml (3.0.3.v201212050047) "OCL for UML" is a total
rogue. There never was a 3.0.3. The Juno release was 4.0.0.

org.eclipse.uml2 (3.1.500.v201212050047) "UML2" also looks non-standard.

org.eclipse.datatools.enablement.apache.derby.feature
(1.100.3.v20140207_1108-779G8hBmSNVvLUz-x1OXGz-6Sm99) looks like a
Kepler component.

So, sorry, there is no way that I will provide unfunded support for
unauthorized mismatching modifications of Eclipse OCL/UML. You must
approach IBM for support.

Regards

Ed Willink




On 28/07/2014 11:56, James Clark wrote:
> On 7/27/14 4:35 PM, Ed Willink wrote:
>> Hi
>>
>> Correction. RSA is not supported by Eclipse. Please contact IBM for
>> support on proprietary and often vintage versions of Eclipse OCL.
>>
>> The v9 web pages suggest deviations from the Eclipse OCL I am
>> familiar with and give no indication as to what was packaged and what
>> is modified.
>>
>> Regards
>>
>> Ed Willink
>>
>> On 27/07/2014 21:21, Ed Willink wrote:
>>> Hi
>>>
>>> Since you use "uml" rather than "UML", I presume you are using the
>>> old Classic OCL in which the incorrect UML2Ecore conversion is
>>> effective.
>>>
>>> The three different queries are very similar so I'm surprised that
>>> there is a problem. AssociationClass is rare, did you mean Association?
>>>
>>> Again since you are using "uml" rather than "UML", I presume you are
>>> using UML.ecore rather UML.uml so you may have inappropriate
>>> UML2Ecore conversion options that lose AssociationClass.
>>>
>>> Without any models or versions, I can only guess. What is c ? Is
>>> element appropriate? The final c.element looks very inefficient when
>>> you can simplify to:
>>>
>>> children.element->selectByKind(uml::AssociationClass)
>>>
>>> Regards
>>>
>>> Ed Willink
>>>
>>>
>>> On 27/07/2014 19:14, James Clark wrote:
>>>> I’m working on a BIRT report on a Rational Software Architect
>>>> (v9.0.0.1) model that will show all of the UML classes,
>>>> enumerations, and association classes for a given class/freeform
>>>> diagram. The report is comprised of three tables with these three
>>>> row queries, which take the URI of the diagram as a parameter:
>>>>
>>>> * oclEvaluate(resolveURI($diagramURI),
>>>> "self.children->select(c|c.element.oclIsKindOf(uml::Class))->collect(c|c.element)")
>>>>
>>>> * oclEvaluate(resolveURI($diagramURI),
>>>> "self.children->select(c|c.element.oclIsKindOf(uml::Enumeration))->collect(c|c.element)")
>>>>
>>>> * oclEvaluate(resolveURI($diagramURI),
>>>> "self.children->select(c|c.element.oclIsKindOf(uml::AssociationClass))->collect(c|c.element)")
>>>>
>>>>
>>>> My problem is that the last query for association classes is not
>>>> returning any present in my diagram. The first two queries work
>>>> fine. Is the OCL correct for association classes? I'm an OCL newbie.
>>>
>>
> Thanks for your response. I've attached the RSA configuration log so
> you could determine what flavor of OCL is being used. I do want
> association classes. I don't know what "c" is in the expression. I
> took this from the RSA Help
> <http://pic.dhe.ibm.com/infocenter/rsahelp/v9/index.jsp?topic=%2Fcom.ibm.ccl.erf.doc%2Ftopics%2Ft_create_report_specifics.html>
> suggestion. I appreciate the fact that these expressions could be
> written more succinctly. So what would be the full expression with
> your suggestion on the use of /selectByKind/?
>
>
Re: OCL query for UML association classes not working [message #1404135 is a reply to message #1403878] Tue, 29 July 2014 20:42 Go to previous message
James Clark is currently offline James ClarkFriend
Messages: 9
Registered: July 2009
Junior Member
On 7/28/14 7:59 AM, Ed Willink wrote:
> Hi
>
> Thanks for the detail. It's certainly a non-standard build.
>
> org.eclipse.ocl (3.2.1.v20120917-1739) is a Juno service release.
> (v201206 plus a bit)
>
> org.eclipse.ocl.uml (3.0.3.v201212050047) "OCL for UML" is a total
> rogue. There never was a 3.0.3. The Juno release was 4.0.0.
>
> org.eclipse.uml2 (3.1.500.v201212050047) "UML2" also looks non-standard.
>
> org.eclipse.datatools.enablement.apache.derby.feature
> (1.100.3.v20140207_1108-779G8hBmSNVvLUz-x1OXGz-6Sm99) looks like a
> Kepler component.
>
> So, sorry, there is no way that I will provide unfunded support for
> unauthorized mismatching modifications of Eclipse OCL/UML. You must
> approach IBM for support.
>
> Regards
>
> Ed Willink
>
>
>
>
> On 28/07/2014 11:56, James Clark wrote:
>> On 7/27/14 4:35 PM, Ed Willink wrote:
>>> Hi
>>>
>>> Correction. RSA is not supported by Eclipse. Please contact IBM for
>>> support on proprietary and often vintage versions of Eclipse OCL.
>>>
>>> The v9 web pages suggest deviations from the Eclipse OCL I am
>>> familiar with and give no indication as to what was packaged and
>>> what is modified.
>>>
>>> Regards
>>>
>>> Ed Willink
>>>
>>> On 27/07/2014 21:21, Ed Willink wrote:
>>>> Hi
>>>>
>>>> Since you use "uml" rather than "UML", I presume you are using the
>>>> old Classic OCL in which the incorrect UML2Ecore conversion is
>>>> effective.
>>>>
>>>> The three different queries are very similar so I'm surprised that
>>>> there is a problem. AssociationClass is rare, did you mean
>>>> Association?
>>>>
>>>> Again since you are using "uml" rather than "UML", I presume you
>>>> are using UML.ecore rather UML.uml so you may have inappropriate
>>>> UML2Ecore conversion options that lose AssociationClass.
>>>>
>>>> Without any models or versions, I can only guess. What is c ? Is
>>>> element appropriate? The final c.element looks very inefficient
>>>> when you can simplify to:
>>>>
>>>> children.element->selectByKind(uml::AssociationClass)
>>>>
>>>> Regards
>>>>
>>>> Ed Willink
>>>>
>>>>
>>>> On 27/07/2014 19:14, James Clark wrote:
>>>>> I’m working on a BIRT report on a Rational Software Architect
>>>>> (v9.0.0.1) model that will show all of the UML classes,
>>>>> enumerations, and association classes for a given class/freeform
>>>>> diagram. The report is comprised of three tables with these three
>>>>> row queries, which take the URI of the diagram as a parameter:
>>>>>
>>>>> * oclEvaluate(resolveURI($diagramURI),
>>>>> "self.children->select(c|c.element.oclIsKindOf(uml::Class))->collect(c|c.element)")
>>>>>
>>>>> * oclEvaluate(resolveURI($diagramURI),
>>>>> "self.children->select(c|c.element.oclIsKindOf(uml::Enumeration))->collect(c|c.element)")
>>>>>
>>>>> * oclEvaluate(resolveURI($diagramURI),
>>>>> "self.children->select(c|c.element.oclIsKindOf(uml::AssociationClass))->collect(c|c.element)")
>>>>>
>>>>>
>>>>> My problem is that the last query for association classes is not
>>>>> returning any present in my diagram. The first two queries work
>>>>> fine. Is the OCL correct for association classes? I'm an OCL newbie.
>>>>
>>>
>> Thanks for your response. I've attached the RSA configuration log so
>> you could determine what flavor of OCL is being used. I do want
>> association classes. I don't know what "c" is in the expression. I
>> took this from the RSA Help
>> <http://pic.dhe.ibm.com/infocenter/rsahelp/v9/index.jsp?topic=%2Fcom.ibm.ccl.erf.doc%2Ftopics%2Ft_create_report_specifics.html>
>> suggestion. I appreciate the fact that these expressions could be
>> written more succinctly. So what would be the full expression with
>> your suggestion on the use of /selectByKind/?
>>
>>
>
A followup to this. I decided to abandon use of OCL in favor of XPath
for my queries into the model. The OCL was too unstable, resulting in
NullPointerExceptions on any sizable model; no doubt a side effect of a
non-standard build, as you pointed out. Although I do see the power of
OCL, the learning curve is just too steep, combined with the fact that I
haven't found any decent tutorials on it. The one take-away from this
experience is that I will avoid using it in the future within RSA. I
can't afford to hold my breath for IBM support.
Previous Topic:org.eclipse.ocl.examples.pivot.scoping.EnvironmentView - Orphan
Next Topic:Constraint validation with imported model not working
Goto Forum:
  


Current Time: Tue Mar 19 11:05:24 GMT 2024

Powered by FUDForum. Page generated in 0.02958 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top