Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » QVT-OML » How to set tagged values after applying a profile
How to set tagged values after applying a profile [message #1746477] Sun, 30 October 2016 14:35 Go to next message
Ferdinando Sodano is currently offline Ferdinando SodanoFriend
Messages: 7
Registered: October 2016
Junior Member
Hello everyone,
I have a sysml input model, in which there are a block element that satisfies two requisites, one of them is dependend by the other (see the attachment).
I want to build a transformation in a output model in which the input models are the input model and the profile model.
The rules are very trivial:
Foreach block, i have to obtain an element MyBlock, with all the requirements that satisfies as own Nested Classifiers.
Requirements are mapped in stereotyped class MyRequirement, having two tagged values: clients and suppliers.
Clients are depending MyRequirement-s from a single Requirement, suppliers are the inverse.
I'm able to generate the instances of MyBlock and MyRequirement, but i'm not able to set the tagged values clients and suppliers.

I tried something of this type:

mapping Class::toMyRequirements(inout parent:Class) : Class when {self.isStereotypeApplied(stereotype_requirement)}
{
	name:= self.name;
	parent.nestedClassifier += result;
		
	
	end 
	{
	result.applyStereotype(stereotype_my_requirement);
	
        result.setValue(stereotype_my_requirement, "suppliers", inmodel[Dependency]->select(client->includes(self)).supplier->late resolveIn(Class::toMyRequirements) };
}


but it doesn't work.

Does exist a method to set tagged values in an appropiate mode? In intenet and in the community I didn't find no topic talking about this arguments.

Thanks to all for the help.
  • Attachment: Immagine.png
    (Size: 48.79KB, Downloaded 35 times)
Re: How to set tagged values after applying a profile [message #1746514 is a reply to message #1746477] Mon, 31 October 2016 13:59 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5395
Registered: July 2009
Senior Member
Hi

The OMG-specified stereotype support in QVTo defines a half-baked * / stereotypedBy capability, requiring quoted text strings. This is nearly as bad as the bypass usage of the Eclipse UML2 Java API.

[ When examining what to do for QVTc/QVTr, for which OMG specifies nothing, it was clear that the standard base_XXX / extension_XXX pseudo-properties should work declaratively as is for both 'read' and 'write'. This insight should eventually be promoted to QVTo too once QVTo uses the Pivot-based OCL that navigates base_XXX / extension_XXX more effectively. ]

Today, I recommend using the Java API and since it can be quite hard to get right, practice it in a bit of Java code that you can single step more easily. Once you are confident that you are using the API correctly, please raise a Bugzilla for any malfunction of that API within Eclipse QVTo.

------

"late resolve" is an interesting but underspecified capability. Eclipse QVTo's implementation is limited to direct expressions. Your usage seems to have much more complexity. [ There is an outstanding OMG QVTo issue to respecify "late" as an M2M from QVTO-with-late to QVTo-without-late. Implementations can then re-use the specification. ] I recommend using your own Dict and to avoid late resolve so that you do not depend on opaque tooling limitations.

Regards

Ed Willink
Re: How to set tagged values after applying a profile [message #1746526 is a reply to message #1746514] Mon, 31 October 2016 16:33 Go to previous messageGo to next message
Ferdinando Sodano is currently offline Ferdinando SodanoFriend
Messages: 7
Registered: October 2016
Junior Member
Thank you for the answer, but I dind't understand if it's possible the problem without using java api. Is it possible with the use of dicts? How? Can you give me an example?

[Updated on: Mon, 31 October 2016 16:34]

Report message to a moderator

Re: How to set tagged values after applying a profile [message #1746579 is a reply to message #1746526] Tue, 01 November 2016 10:21 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5395
Registered: July 2009
Senior Member
Hi

You are confusing two issues.

The most predictable access to stereotype functionality in QVTo is to use the java API.

The most predictable solution to a complex late resolve is to maintain your own Dict of resolutions.

Regards

Ed Willink
Previous Topic:setValue() a Stereotype with another Stereotype
Next Topic:Refine profiled model in QVT-OML
Goto Forum:
  


Current Time: Sat Sep 23 14:52:32 GMT 2017

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

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