Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL 2.0 question
OCL 2.0 question [message #29113] Thu, 21 June 2007 10:18 Go to next message
Eclipse UserFriend
Originally posted by: krzysztof_kaczmarski.o2.pl

Hi All,

I'd like to ask about OCL 2.0 integration with UML. I saw several
packages in the plugin but don't know yet how do they work. Is it
possible to use OCL expression in any place of UML model where for
example ValueSpecification can be used? According to OCL 2.0
specification that would be a consistent integration and thus
ExpressionInOCL as a subclass of OpaqueExpression is introduced to the
metamodel.

So for example is it possible to
1. Create an Activity
2. Create a Variable and AddVariableValueAction in that activity.
3. Create a ValuePin connected to the action
4. Finally specify the pin's value using ExpressionInOCL that is
connected to some OCL expression ?

If it is possible how could it be done?
Is that a correct way:

ValuePin vpin;
vpin.createValue("myval", resultType,
org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?

What will happen if I save such a model do uml format?
Will OCL expression metaclasses be correctly serialized?

Thanks for help.
Krzysztof
Re: OCL 2.0 question [message #29226 is a reply to message #29113] Thu, 21 June 2007 10:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

See some replies in-line, below.

Cheers,

Christian

Krzysztof Kaczmarski wrote:

> Hi All,

> I'd like to ask about OCL 2.0 integration with UML. I saw several
> packages in the plugin but don't know yet how do they work. Is it
> possible to use OCL expression in any place of UML model where for
> example ValueSpecification can be used? According to OCL 2.0
> specification that would be a consistent integration and thus
> ExpressionInOCL as a subclass of OpaqueExpression is introduced to the
> metamodel.

That is the intent of the ExpressionInOcl, yes, to be used in UML models
whereever a ValueSpecification may be used.


> So for example is it possible to
> 1. Create an Activity
> 2. Create a Variable and AddVariableValueAction in that activity.
> 3. Create a ValuePin connected to the action
> 4. Finally specify the pin's value using ExpressionInOCL that is
> connected to some OCL expression ?

Yes.


> If it is possible how could it be done?
> Is that a correct way:
>
> ValuePin vpin;
> vpin.createValue("myval", resultType,
> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?

What you really need to create a well-formed ExpressionInOcl instance is
to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL instance
initialized with the ResourceSet containing your UML model to create an
OCLHelper. Set the helper's context classifier to be the behaviored
classifier containing your activity, then use the createQuery(String)
method to parse the OCL expression that computes the ValuePin's value.
The resulting OclExpression can be used as the bodyExpression of your
ExpressionInOcl.

> What will happen if I save such a model do uml format?
> Will OCL expression metaclasses be correctly serialized?

They should be, yes. Just remember that the ExpressionInOcl in this case
requires a contextVariable representing "self" in addition to the
bodyExpression.

> Thanks for help.
> Krzysztof
Re: OCL 2.0 question [message #29490 is a reply to message #29226] Fri, 22 June 2007 17:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: krzysztof_kaczmarski.o2.pl

Thanks Christian,

I am curious about the OCL parser. What will happen if an expression
refers to an attribute that is defined in another object?
Will the parser create some kind of a reference?

Thanks again,
Krzysztof

Christian W. Damus wrote:
> Hi, Krzysztof,
>
> See some replies in-line, below.
>
> Cheers,
>
> Christian
>
> Krzysztof Kaczmarski wrote:
>
>> Hi All,
>
>> I'd like to ask about OCL 2.0 integration with UML. I saw several
>> packages in the plugin but don't know yet how do they work. Is it
>> possible to use OCL expression in any place of UML model where for
>> example ValueSpecification can be used? According to OCL 2.0
>> specification that would be a consistent integration and thus
>> ExpressionInOCL as a subclass of OpaqueExpression is introduced to the
>> metamodel.
>
> That is the intent of the ExpressionInOcl, yes, to be used in UML models
> whereever a ValueSpecification may be used.
>
>
>> So for example is it possible to
>> 1. Create an Activity
>> 2. Create a Variable and AddVariableValueAction in that activity.
>> 3. Create a ValuePin connected to the action
>> 4. Finally specify the pin's value using ExpressionInOCL that is
>> connected to some OCL expression ?
>
> Yes.
>
>
>> If it is possible how could it be done?
>> Is that a correct way:
>>
>> ValuePin vpin;
>> vpin.createValue("myval", resultType,
>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>
> What you really need to create a well-formed ExpressionInOcl instance is
> to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL instance
> initialized with the ResourceSet containing your UML model to create an
> OCLHelper. Set the helper's context classifier to be the behaviored
> classifier containing your activity, then use the createQuery(String)
> method to parse the OCL expression that computes the ValuePin's value.
> The resulting OclExpression can be used as the bodyExpression of your
> ExpressionInOcl.
>
>> What will happen if I save such a model do uml format?
>> Will OCL expression metaclasses be correctly serialized?
>
> They should be, yes. Just remember that the ExpressionInOcl in this
> case requires a contextVariable representing "self" in addition to the
> bodyExpression.
>
>> Thanks for help.
>> Krzysztof
>
Re: OCL 2.0 question [message #30114 is a reply to message #29490] Mon, 25 June 2007 19:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

Yes, the OCL expression will include an instance of the PropertyCallExp
metaclass having a "referredProperty" value referencing the attribute in
question.

I suggest playing with the Interactive OCL Console example (see the Examples
Guide in the OCL Developer Guide for installation and usage information) to
save a variety of OCL expressions as XMI, to see what the results look
like. Of particular interest should be the persistence of CollectionTypes,
TupleTypes, and other metaclasses that OCL defines on-the-fly as required
by your expressions.

Cheers,

Christian


Krzysztof Kaczmarski wrote:

> Thanks Christian,
>
> I am curious about the OCL parser. What will happen if an expression
> refers to an attribute that is defined in another object?
> Will the parser create some kind of a reference?
>
> Thanks again,
> Krzysztof
>

<snip>
Re: OCL 2.0 question [message #30460 is a reply to message #29226] Tue, 26 June 2007 12:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: krzysztof_kaczmarski.o2.pl

Hi Christian, thanks for your answer.

As far as I understood from tutorials and working example,
helper.setContext( classifier ) requires the classifier of the object
that is going to be the query starting point.
That may be not accessible in my case.
I will not generate java code for the model's editor.
So probably I will not be able to use the OCL parser, but I hope that
there is still some other way to create ExpressionInOcl?
Just manual...

Cheers,
Krzysztof


Christian W. Damus wrote:
> Hi, Krzysztof,
>
> See some replies in-line, below.
>
> Cheers,
>
> Christian
>
> Krzysztof Kaczmarski wrote:
>
>> Hi All,
>
>> I'd like to ask about OCL 2.0 integration with UML. I saw several
>> packages in the plugin but don't know yet how do they work. Is it
>> possible to use OCL expression in any place of UML model where for
>> example ValueSpecification can be used? According to OCL 2.0
>> specification that would be a consistent integration and thus
>> ExpressionInOCL as a subclass of OpaqueExpression is introduced to the
>> metamodel.
>
> That is the intent of the ExpressionInOcl, yes, to be used in UML models
> whereever a ValueSpecification may be used.
>
>
>> So for example is it possible to
>> 1. Create an Activity
>> 2. Create a Variable and AddVariableValueAction in that activity.
>> 3. Create a ValuePin connected to the action
>> 4. Finally specify the pin's value using ExpressionInOCL that is
>> connected to some OCL expression ?
>
> Yes.
>
>
>> If it is possible how could it be done?
>> Is that a correct way:
>>
>> ValuePin vpin;
>> vpin.createValue("myval", resultType,
>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>
> What you really need to create a well-formed ExpressionInOcl instance is
> to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL instance
> initialized with the ResourceSet containing your UML model to create an
> OCLHelper. Set the helper's context classifier to be the behaviored
> classifier containing your activity, then use the createQuery(String)
> method to parse the OCL expression that computes the ValuePin's value.
> The resulting OclExpression can be used as the bodyExpression of your
> ExpressionInOcl.
>
>> What will happen if I save such a model do uml format?
>> Will OCL expression metaclasses be correctly serialized?
>
> They should be, yes. Just remember that the ExpressionInOcl in this
> case requires a contextVariable representing "self" in addition to the
> bodyExpression.
>
>> Thanks for help.
>> Krzysztof
>
Re: OCL 2.0 question [message #30563 is a reply to message #30460] Tue, 26 June 2007 13:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

The UML model in which you are creating OCL expressions has the classifiers
that define the type system for those expressions, and which are "context
classifiers" with which you would configure the OCLHelper. This includes
all of the Classes, Interfaces, DataTypes, Enumerations, PrimitiveTypes,
Associations, etc. in the UML model.

Yes, you can use the OCL metamodel API (org.eclipse.ocl.expressions package)
to construct the AST of an OclExpression to provide the bodyExpression
value of the ExpressionInOcl. However, in order to be well-formed,
OclExpressions require references to the classifiers that are their types,
and these classifiers are the same ones in the UML model that you would use
as the context classifier in the OCLHelper.

HTH,

Christian


Krzysztof Kaczmarski wrote:

> Hi Christian, thanks for your answer.
>
> As far as I understood from tutorials and working example,
> helper.setContext( classifier ) requires the classifier of the object
> that is going to be the query starting point.
> That may be not accessible in my case.
> I will not generate java code for the model's editor.
> So probably I will not be able to use the OCL parser, but I hope that
> there is still some other way to create ExpressionInOcl?
> Just manual...
>
> Cheers,
> Krzysztof
>
>
> Christian W. Damus wrote:
>> Hi, Krzysztof,
>>
>> See some replies in-line, below.
>>
>> Cheers,
>>
>> Christian
>>
>> Krzysztof Kaczmarski wrote:
>>
>>> Hi All,
>>
>>> I'd like to ask about OCL 2.0 integration with UML. I saw several
>>> packages in the plugin but don't know yet how do they work. Is it
>>> possible to use OCL expression in any place of UML model where for
>>> example ValueSpecification can be used? According to OCL 2.0
>>> specification that would be a consistent integration and thus
>>> ExpressionInOCL as a subclass of OpaqueExpression is introduced to the
>>> metamodel.
>>
>> That is the intent of the ExpressionInOcl, yes, to be used in UML models
>> whereever a ValueSpecification may be used.
>>
>>
>>> So for example is it possible to
>>> 1. Create an Activity
>>> 2. Create a Variable and AddVariableValueAction in that activity.
>>> 3. Create a ValuePin connected to the action
>>> 4. Finally specify the pin's value using ExpressionInOCL that is
>>> connected to some OCL expression ?
>>
>> Yes.
>>
>>
>>> If it is possible how could it be done?
>>> Is that a correct way:
>>>
>>> ValuePin vpin;
>>> vpin.createValue("myval", resultType,
>>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>>
>> What you really need to create a well-formed ExpressionInOcl instance is
>> to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL instance
>> initialized with the ResourceSet containing your UML model to create an
>> OCLHelper. Set the helper's context classifier to be the behaviored
>> classifier containing your activity, then use the createQuery(String)
>> method to parse the OCL expression that computes the ValuePin's value.
>> The resulting OclExpression can be used as the bodyExpression of your
>> ExpressionInOcl.
>>
>>> What will happen if I save such a model do uml format?
>>> Will OCL expression metaclasses be correctly serialized?
>>
>> They should be, yes. Just remember that the ExpressionInOcl in this
>> case requires a contextVariable representing "self" in addition to the
>> bodyExpression.
>>
>>> Thanks for help.
>>> Krzysztof
>>
Re: OCL 2.0 question [message #35910 is a reply to message #30460] Wed, 22 August 2007 12:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: krzysztof_kaczmarski.o2.pl

Hi Christian, thanks for your answer.

You said that ExpressionInOCL object may be filled in by OCL parser,
which must be properly initialized:

>>> ValuePin vpin;
>>> vpin.createValue("myval", resultType,
>>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>>
>> What you really need to create a well-formed ExpressionInOcl instance
>> is to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL
>> instance initialized with the ResourceSet containing your UML model to
>> create an OCLHelper. Set the helper's context classifier to be the
>> behaviored classifier containing your activity, then use the
>> createQuery(String) method to parse the OCL expression that computes
>> the ValuePin's value. The resulting OclExpression can be used as the
>> bodyExpression of your ExpressionInOcl.

But what if I cannot use the built-in OCL parser, for instance when I
have got my own parser of in fact different language and want to
create UML model for my custom language AST?

Is this manual approach referenced by me before could be effectively used?

Thanks again,
Krzysztof
Re: OCL 2.0 question [message #35978 is a reply to message #35910] Wed, 22 August 2007 12:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

Yes, absolutely. All that the parser really does is to convert OCL text to
an instance of the OCL Abstract Syntax Model. So, you can convert your
DSL's text to the same OCL model.

To help you make sure that you did the conversion correctly, the OCL parser
provides a validation visitor that will walk your ExpressionInOCL to ensure
that it is well-formed. The ValidationVisitor class is, however, internal
in the 1.1 release ...

Cheers,

Christian


Krzysztof Kaczmarski wrote:

> Hi Christian, thanks for your answer.
>
> You said that ExpressionInOCL object may be filled in by OCL parser,
> which must be properly initialized:
>
>>>> ValuePin vpin;
>>>> vpin.createValue("myval", resultType,
>>>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>>>
>>> What you really need to create a well-formed ExpressionInOcl instance
>>> is to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL
>>> instance initialized with the ResourceSet containing your UML model to
>>> create an OCLHelper. Set the helper's context classifier to be the
>>> behaviored classifier containing your activity, then use the
>>> createQuery(String) method to parse the OCL expression that computes
>>> the ValuePin's value. The resulting OclExpression can be used as the
>>> bodyExpression of your ExpressionInOcl.
>
> But what if I cannot use the built-in OCL parser, for instance when I
> have got my own parser of in fact different language and want to
> create UML model for my custom language AST?
>
> Is this manual approach referenced by me before could be effectively used?
>
> Thanks again,
> Krzysztof
Re: OCL 2.0 question [message #36046 is a reply to message #35978] Wed, 22 August 2007 13:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: krzysztof_kaczmarski.o2.pl

Hi Christian,

Ok. I created an ExpressionInOCL:

ExpressionInOCL expr = (ExpressionInOCL)
valuePin.createValue("rValueExprInOCL", rValueElement.getType(),
org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL);

and now, I need to create OclExpression and insert it as a body:

expr.setBodyExpression( oclExpression );

but how can I manually create the oclExpression object and all other
parts of the remaining ocl?

Regards,
Krzysztof


Christian W. Damus wrote:
> Hi, Krzysztof,
>
> Yes, absolutely. All that the parser really does is to convert OCL text to
> an instance of the OCL Abstract Syntax Model. So, you can convert your
> DSL's text to the same OCL model.
>
> To help you make sure that you did the conversion correctly, the OCL parser
> provides a validation visitor that will walk your ExpressionInOCL to ensure
> that it is well-formed. The ValidationVisitor class is, however, internal
> in the 1.1 release ...
>
> Cheers,
>
> Christian
>
>
> Krzysztof Kaczmarski wrote:
>
>> Hi Christian, thanks for your answer.
>>
>> You said that ExpressionInOCL object may be filled in by OCL parser,
>> which must be properly initialized:
>>
>>>>> ValuePin vpin;
>>>>> vpin.createValue("myval", resultType,
>>>>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>>>> What you really need to create a well-formed ExpressionInOcl instance
>>>> is to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL
>>>> instance initialized with the ResourceSet containing your UML model to
>>>> create an OCLHelper. Set the helper's context classifier to be the
>>>> behaviored classifier containing your activity, then use the
>>>> createQuery(String) method to parse the OCL expression that computes
>>>> the ValuePin's value. The resulting OclExpression can be used as the
>>>> bodyExpression of your ExpressionInOcl.
>> But what if I cannot use the built-in OCL parser, for instance when I
>> have got my own parser of in fact different language and want to
>> create UML model for my custom language AST?
>>
>> Is this manual approach referenced by me before could be effectively used?
>>
>> Thanks again,
>> Krzysztof
>
Re: OCL 2.0 question [message #36080 is a reply to message #36046] Wed, 22 August 2007 16:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Krzysztof,

You will need to use the generated factory class to instantiate the various
elements of the OCL model and connect them together:

org.eclipse.ocl.uml.UMLFactory

There are some difficulties, though, that you will encounter. In
particular, the OCL specification doesn't provide much guidance on how to
persist many the classifiers that OCL defines implicitly, including:

- CollectionTypes -- e.g., Set(String), Sequence(Bag(Employee))
- TupleTypes -- e.g., Tuple(name : String, emp : Employee)
- OclMessages

You will have to create instances of these metaclasses for certain
expressions, and will then need to find some place in your UML model where
you can attach them. They might be additional roots of your resource if
you use an XMIResource, or they might be stored as contents of an
EAnnotation on your ExpressionInOCL, or ...

Other expressions will simply reference types defined in your model or by
OCL, itself, which can be obtained from the OCLStandardLibrary interface.

In the end, the parsed OCL expression is really just another instance of an
EMF-based metamodel.

Cheers,

Christian

Krzysztof Kaczmarski wrote:

> Hi Christian,
>
> Ok. I created an ExpressionInOCL:
>
> ExpressionInOCL expr = (ExpressionInOCL)
> valuePin.createValue("rValueExprInOCL", rValueElement.getType(),
> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL);
>
> and now, I need to create OclExpression and insert it as a body:
>
> expr.setBodyExpression( oclExpression );
>
> but how can I manually create the oclExpression object and all other
> parts of the remaining ocl?
>
> Regards,
> Krzysztof
>
>
> Christian W. Damus wrote:
>> Hi, Krzysztof,
>>
>> Yes, absolutely. All that the parser really does is to convert OCL text
>> to
>> an instance of the OCL Abstract Syntax Model. So, you can convert your
>> DSL's text to the same OCL model.
>>
>> To help you make sure that you did the conversion correctly, the OCL
>> parser provides a validation visitor that will walk your ExpressionInOCL
>> to ensure
>> that it is well-formed. The ValidationVisitor class is, however,
>> internal in the 1.1 release ...
>>
>> Cheers,
>>
>> Christian
>>
>>
>> Krzysztof Kaczmarski wrote:
>>
>>> Hi Christian, thanks for your answer.
>>>
>>> You said that ExpressionInOCL object may be filled in by OCL parser,
>>> which must be properly initialized:
>>>
>>>>>> ValuePin vpin;
>>>>>> vpin.createValue("myval", resultType,
>>>>>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>>>>> What you really need to create a well-formed ExpressionInOcl instance
>>>>> is to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL
>>>>> instance initialized with the ResourceSet containing your UML model to
>>>>> create an OCLHelper. Set the helper's context classifier to be the
>>>>> behaviored classifier containing your activity, then use the
>>>>> createQuery(String) method to parse the OCL expression that computes
>>>>> the ValuePin's value. The resulting OclExpression can be used as the
>>>>> bodyExpression of your ExpressionInOcl.
>>> But what if I cannot use the built-in OCL parser, for instance when I
>>> have got my own parser of in fact different language and want to
>>> create UML model for my custom language AST?
>>>
>>> Is this manual approach referenced by me before could be effectively
>>> used?
>>>
>>> Thanks again,
>>> Krzysztof
>>
Re: OCL 2.0 question [message #36148 is a reply to message #36080] Wed, 22 August 2007 17:22 Go to previous message
Eclipse UserFriend
Originally posted by: krzysztof_kaczmarski.o2.pl

Thanks for this reply.
I hope the problems will not be to hard.

I will inform you if we shall have something interesting implemented.

Cheers,
Krzysztof

Christian W. Damus wrote:
> Hi, Krzysztof,
>
> You will need to use the generated factory class to instantiate the various
> elements of the OCL model and connect them together:
>
> org.eclipse.ocl.uml.UMLFactory
>
> There are some difficulties, though, that you will encounter. In
> particular, the OCL specification doesn't provide much guidance on how to
> persist many the classifiers that OCL defines implicitly, including:
>
> - CollectionTypes -- e.g., Set(String), Sequence(Bag(Employee))
> - TupleTypes -- e.g., Tuple(name : String, emp : Employee)
> - OclMessages
>
> You will have to create instances of these metaclasses for certain
> expressions, and will then need to find some place in your UML model where
> you can attach them. They might be additional roots of your resource if
> you use an XMIResource, or they might be stored as contents of an
> EAnnotation on your ExpressionInOCL, or ...
>
> Other expressions will simply reference types defined in your model or by
> OCL, itself, which can be obtained from the OCLStandardLibrary interface.
>
> In the end, the parsed OCL expression is really just another instance of an
> EMF-based metamodel.
>
> Cheers,
>
> Christian
>
> Krzysztof Kaczmarski wrote:
>
>> Hi Christian,
>>
>> Ok. I created an ExpressionInOCL:
>>
>> ExpressionInOCL expr = (ExpressionInOCL)
>> valuePin.createValue("rValueExprInOCL", rValueElement.getType(),
>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL);
>>
>> and now, I need to create OclExpression and insert it as a body:
>>
>> expr.setBodyExpression( oclExpression );
>>
>> but how can I manually create the oclExpression object and all other
>> parts of the remaining ocl?
>>
>> Regards,
>> Krzysztof
>>
>>
>> Christian W. Damus wrote:
>>> Hi, Krzysztof,
>>>
>>> Yes, absolutely. All that the parser really does is to convert OCL text
>>> to
>>> an instance of the OCL Abstract Syntax Model. So, you can convert your
>>> DSL's text to the same OCL model.
>>>
>>> To help you make sure that you did the conversion correctly, the OCL
>>> parser provides a validation visitor that will walk your ExpressionInOCL
>>> to ensure
>>> that it is well-formed. The ValidationVisitor class is, however,
>>> internal in the 1.1 release ...
>>>
>>> Cheers,
>>>
>>> Christian
>>>
>>>
>>> Krzysztof Kaczmarski wrote:
>>>
>>>> Hi Christian, thanks for your answer.
>>>>
>>>> You said that ExpressionInOCL object may be filled in by OCL parser,
>>>> which must be properly initialized:
>>>>
>>>>>>> ValuePin vpin;
>>>>>>> vpin.createValue("myval", resultType,
>>>>>>> org.eclipse.ocl.uml.UMLPackage.Literals.EXPRESSION_IN_OCL); ?
>>>>>> What you really need to create a well-formed ExpressionInOcl instance
>>>>>> is to parse an OCL expression. Use an org.eclipse.ocl.uml.OCL
>>>>>> instance initialized with the ResourceSet containing your UML model to
>>>>>> create an OCLHelper. Set the helper's context classifier to be the
>>>>>> behaviored classifier containing your activity, then use the
>>>>>> createQuery(String) method to parse the OCL expression that computes
>>>>>> the ValuePin's value. The resulting OclExpression can be used as the
>>>>>> bodyExpression of your ExpressionInOcl.
>>>> But what if I cannot use the built-in OCL parser, for instance when I
>>>> have got my own parser of in fact different language and want to
>>>> create UML model for my custom language AST?
>>>>
>>>> Is this manual approach referenced by me before could be effectively
>>>> used?
>>>>
>>>> Thanks again,
>>>> Krzysztof
>
Previous Topic:Please help me: Parse failed: ERROR in (packageDeclarationCS): (Unable to find package: ( uml))
Next Topic:new to ocl - how to check ocl on uml model
Goto Forum:
  


Current Time: Thu Mar 28 11:51:22 GMT 2024

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

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

Back to the top