Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » commit in EOL(commit in EOL)
commit in EOL [message #1758000] Wed, 22 March 2017 16:58 Go to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi,
I am writing EOL code including nested loop with nested if statements and inside the loop i am calling some update operations to add elements to a model and i am querying the model inside the loop and each time i got error even i can see the new element in the model,i am wondering if i can query the update(new element added to the model) during the loop or i have to query the update after exiting the loop?
Can i explicitly commit the changes during the execution or is there any trick to do that??


Thanks ,
Taghreed
Re: commit in EOL [message #1758001 is a reply to message #1758000] Wed, 22 March 2017 16:59 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

You can call <model-name>.store() anywhere in your code.

Cheers,
Dimitris
Re: commit in EOL [message #1758012 is a reply to message #1758001] Wed, 22 March 2017 18:15 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi Dimitris,
Unfortunately it didn't work Sad
I don't know why,i am adding example1Trace .store() after call addTrace operation .
Below is part of the code
else{//else part when right is not defined
	                     var LeftElementName=getName(UmlIdLeft);
	                     if (isTraceExists(LeftElementName)=false){
	                         var UmlType=getType(UmlIdLeft);
	                         "yssssssssssssss".println();
	                         if (TransferredElements.includes(UmlType)){ 
	                         if (UmlType<>"ControlFlow"){
	                          "no Trace for this left because no right(old)".println();
							                          var DeviceParent=getDeviceForArtifact(LeftElementName).println();//first we need to add the parent
							                          "DeviceParent".print()+DeviceParent.println();
							                           addChild(Lqn!processor,DeviceParent.name,LeftElementName);//from mapping we are able to know that device is processor and parent for artifact
					                                   addTrace(LeftElementName,UmlType,"task");
					                                   example1Trace.store();
					                                   "pleaseeeeee".print()+isTraceExists(LeftElementName).println();
				                                       }else { for (flow in UML!ControlFlow) {
							                           if (flow.name=LeftElementName){
							                              if (guardForControlFlowToPrecedence(flow)=true){
							                              "create new elemet its type = control flow".println();
							                               addSyncall(flow.source,flow.target);
							                              [b] addTrace(LeftElementName,UmlType,"synchcall");
							                               example1Trace.store();[/b]
							                              }else if(controlflowProcessingforSyncCall(flow)=true){
							                                "create new elemet its type = control flow".println();
							                                addSyncall(flow.source,flow.target.name);
							                               addTrace(LeftElementName,UmlType,"synchcall");}else if(controlflowProcessingforASyncCall(flow)="true"){
							                               "create new elemet its type = control flow".println();
							                               addASyncall(flow.source,flow.target);
							                               [b]addTrace(LeftElementName,UmlType,"Asynchcall");
							                               example1Trace.store();[/b]}
							                                
					                                    }

[Updated on: Wed, 22 March 2017 18:18]

Report message to a moderator

Re: commit in EOL [message #1758034 is a reply to message #1758012] Wed, 22 March 2017 20:34 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

In the absence of a minimal example I can use to reproduce this, there's little I can do to help I'm afraid.

Cheers,
Dimitris
Re: commit in EOL [message #1758039 is a reply to message #1758034] Wed, 22 March 2017 21:15 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Ok i will send a minimal example . I am updating example1Trace. as xml file in the run configuration for the EOL so can i still use store()??

[Updated on: Wed, 22 March 2017 21:16]

Report message to a moderator

Re: commit in EOL [message #1758040 is a reply to message #1758039] Wed, 22 March 2017 21:16 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

Yes - that shouldn't be a problem.

Cheers,
Dimitris
Re: commit in EOL [message #1758049 is a reply to message #1758040] Thu, 23 March 2017 03:03 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi Dimitris,
I have attached minimal example to produce the problem .I am trying to update example1Trace by adding new trace and then I am trying to query example1Trace model by operation isTraceExists if the trace exists or not.
I expected that isTraceExists operation returns true after using example1Trace.store();
I am using Eclipse version 1.3.201602270002.
To produce the problem please run queryETL(1).lunch and then open example1Trace so you can see that it has been updated by the addTrace operation but isTraceExists operation returns false.

Cheers,
Taghreed.

Re: commit in EOL [message #1758086 is a reply to message #1758049] Thu, 23 March 2017 12:00 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

I wasn't able to run your example as-is as a metamodel is missing. When I removed the metamodel-less model from the launch configuration, and set the content of queryETL.eol to "example1Trace.store();" the program ran without errors. I am not sure I understand the nature of the problem you're encountering.

Looking at your last few posts and at the example you shared I would like to encourage you to put additional effort in (1) explaining the precise nature of the problem you are facing and (2) making sure that the examples you share are self-contained and *genuinely* minimal. From my experience most Epsilon-related problems can be demonstrated with one model/metamodel and 4-5 lines of code.

Cheers,
Dimitris

[Updated on: Thu, 23 March 2017 12:02]

Report message to a moderator

Re: commit in EOL [message #1758146 is a reply to message #1758086] Thu, 23 March 2017 20:49 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi Dimitris,
I am really sorry for sending incomplete example. I have attached more clear and complete minimal example. This example doesn't generate any errors but it represents different behaviour from what I am expecting.
I am expecting that isTraceExists(ElementName) operation to return true after updating example1Trace model by executing the operation addTrace .

To see this unexpected behaviour please run queryETL(1).lunch file ,you will see that isTraceExists(ElementName) returns false even though addTrace operation updated example1Trace model successfully and I used example1Trace.store();
I hope that I have explained the problem in a more clear way.

Thanks,
Taghreed

[Updated on: Thu, 23 March 2017 21:08]

Report message to a moderator

Re: commit in EOL [message #1758346 is a reply to message #1758146] Mon, 27 March 2017 20:49 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

Looking at your attached archive, it contains an Eclipse project ("lqnmodel") and then two sibling folders ("evolving Source Model" and "TraceabilityExample"). I'm not sure what I need to do with these folders (do I need to import them as separate projects? copy them into the attached project?). Also, I can see an ETL transformation in the archive ("TraceabilityFeb3.etl"). Do I need to run it? If not, then it shouldn't be part of the archive. I'm sorry if I'm being pedantic but I'd appreciate it if you could have another go at this and attach one Eclipse project that contains *only* the files I need to reproduce the problem you're encountering.

Cheers,
Dimitris
Re: commit in EOL [message #1758351 is a reply to message #1758346] Tue, 28 March 2017 02:03 Go to previous messageGo to next message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi Dimitris,
I do really apologize for the inconvenience i made:( i do not know what is going with me .I have attached two folders (i exported them from eclipse as it is).
TraceabilityExamples folder has:
metamodels which has Lqn2umlTarce metamodel

Evolving Source Model folder has:
Example1Trace.ecore a model an instance of Lqn2umlTarce metamodel
queryETL(1).launch
queryETL.eol

To reproduce the problem :
1-run queryETL(1).launch
2- isTraceExists(ElementName) will return false even though addTrace operation updated example1Trace model successfully and I used example1Trace.store();

I hope this time my example is complete and sorry again for the inconvenience .

Cheers,
Taghreed

[Updated on: Tue, 28 March 2017 02:04]

Report message to a moderator

Re: commit in EOL [message #1758362 is a reply to message #1758351] Tue, 28 March 2017 06:40 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2154
Registered: July 2009
Location: York, UK
Senior Member

Hi Taghreed,

In line 14, you should replace

for(s in links) {


with

for(s in example1Trace!t_links.all) {


In the future, it'd be great if you could attach exported Eclipse projects which can imported directly into a new workspace as opposed to plain folders. Moreover, the TraceabilityExample folder doesn't seem to be necessary for this example (and thus should have been omitted). Finally, you appear to be querying and modifying an XMI model using the plain XML driver. Is there any particular reason why you're not treating it as a regular EMF model?

Cheers,
Dimitris

Re: commit in EOL [message #1758427 is a reply to message #1758362] Tue, 28 March 2017 14:53 Go to previous message
taghreed altamimi is currently offline taghreed altamimiFriend
Messages: 184
Registered: October 2014
Senior Member
Hi Dimitris,
Thanks very much for your patience and your help,i appreciated so much.Frankly no specific reason for querying and modifying the model as XMI ,Do you recommend to query the model as EMF model??

Cheers,
Taghreed
Previous Topic:EVL and Papyrus
Next Topic:problem with adding element to ordered set
Goto Forum:
  


Current Time: Fri Mar 29 11:59:47 GMT 2024

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

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

Back to the top