|
Re: inter-models OCLs [message #1449640 is a reply to message #1449602] |
Tue, 21 October 2014 16:53 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
I'm a bit confused since you make some inaccurate statements.
Each OCL Constraint is per-context, which in the case of your Profile is
probably a Stereotype.
The OCL Constraint can be validated for any Element to which that
Stereotype is applied.
Models do not come in to it, except in so far as models maybe the quanta
in which you load Elements.
I am not clear how you can expect a tool to validate models that you
have not loaded. It could be done but the time taken to search the
Internet for all possible models would be prohibitive and it would not
find models behind firewalls unless of course you have an algorithm that
can hack through firewalls in which case ..... good luck.
Perhaps you should draw yourself some pictures so that you understand
what you are really trying to do.
Regards
Ed Willink
On 21/10/2014 16:37, Mahin Abbasipour wrote:
> Hi,
>
> I have a UML profile in Papyrus and I create some models and apply the
> created profile on them.
> when I write an OCL for a profile, these OCLs are per model. suppose
> that the profile has a steretype called "A" with a tag value (attribute)
> "a". if I write an OCL that the summation of value "a" for all instances
> of A should be greater than 10, then it is checked per each model; while
> I want to have an OCL that checks the summation of attribute "a" for all
> instances in all models to be greater than 10. the number of models
> which are instances of the created metamodel is unknown,
> Is it possible to write such OCLs? If not, which tool is used for these
> purposes? Can you provide the tutorial as well?
>
> Thank you very much,
> Mahin
|
|
|
|
|
|
Re: inter-models OCLs [message #1450596 is a reply to message #1450481] |
Wed, 22 October 2014 16:30 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
It would seem that an easy way to solve that problem is by reference
counting on the constrained resource. Using EMF, you might use
bidirectional references to ensure that the 'counts' are accurately
maintained. You could use an OCL constraint to impose the limit, but why
not exploit the upper bound of the multiplicity? No need for a
programmatic constraint at all.
Regards
Ed Willink
On 22/10/2014 14:46, Mahin Abbasipour wrote:
> Hi Ed,
>
> By instance models, I mean the models that I create and apply the
> defined profile on them.
> When we define a profile, someone can make any number of models and
> apply the defined profile on them. Suppose, each model is for a separate
> user using a resource. we have a capacity for that resource, and we want
> to be sure, the summation of all used resources is not more than a total
> capacity (it's an example).
|
|
|
Powered by
FUDForum. Page generated in 0.03514 seconds