Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Querying UML file in EOL
Querying UML file in EOL [message #1771512] Fri, 25 August 2017 21:37 Go to next message
Kanchan NAir is currently offline Kanchan NAirFriend
Messages: 8
Registered: July 2017
Junior Member
Hello,

Is it possible to query in EOL just by giving an external UML file. I don't want to go through full model

Right now I am calling whole model by
umlModelName!Package.all.select(c|c.name="RootElement") by giving .uml file as input in Run configuration

But not sure if giving a .uml file as input is gonna work, I mean programmatically.

I am trying to give a uml file as input from java file to eol file

Please suggest

[Updated on: Fri, 25 August 2017 22:16]

Report message to a moderator

Re: Querying UML file in EOL [message #1771518 is a reply to message #1771512] Sat, 26 August 2017 09:36 Go to previous messageGo to next message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Hi,

Yes, Epsilon can take UML models that conform to the UML Ecore metamodel as input. I understand that you would like to do that programmatically and not by the creating a run configuration via the UI.
This example [1] demonstrates how to create and run a standalone EOL program using Java. In order to add a UML model in the model repository instead of an EmfModel shown in the example you need to create an instance of the UmlModel class (see org.eclipse.epsilon.emc.uml package).

Please make sure that you load the UML Ecore metamodel (http://www.eclipse.org/uml2/5.0.0/UML) in the StringProperties properties of the UmlModel you created.

Then you can execute the EOL File you created and parsed that includes commands like umlModelName!Class.all() which returns all the UML classes in the model, or umlModelName!Package.all(), etc.

Hope that helps,
Thanos

[1]: https://eclipse.org/epsilon/examples/index.php?example=org.eclipse.epsilon.examples.standalone
Re: Querying UML file in EOL [message #1771620 is a reply to message #1771518] Mon, 28 August 2017 17:18 Go to previous messageGo to next message
Kanchan NAir is currently offline Kanchan NAirFriend
Messages: 8
Registered: July 2017
Junior Member
Thank you very much, I will try that.
Re: Querying UML file in EOL [message #1771623 is a reply to message #1771518] Mon, 28 August 2017 17:35 Go to previous messageGo to next message
Kanchan NAir is currently offline Kanchan NAirFriend
Messages: 8
Registered: July 2017
Junior Member
Thank you very much, I will try that.
Re: Querying UML file in EOL [message #1771729 is a reply to message #1771623] Wed, 30 August 2017 00:31 Go to previous messageGo to next message
Kanchan NAir is currently offline Kanchan NAirFriend
Messages: 8
Registered: July 2017
Junior Member
Hello,

I tried creating program using the Standalone Example and I was able to run the uml file as Java Application

However when I run same program as a plugin project it gives me error

I used this code

module = createModule(); 
module.parse(getFile(getSource()));

 public String getSource() throws Exception {
	      return "eol/call.eol";
	  }


 protected File getFile(String fileName) throws URISyntaxException { 

		URI binUri = EpsilonClass.class.getResource(fileName).toURI();
		URI uri = null;
		
		if (binUri.toString().indexOf("bin") > -1) {
			uri = new URI(binUri.toString().replaceAll("bin", "src"));
		}
		else {
			uri = binUri;
		}
		return new File(uri);
	}
}


Error is, it doesn't give me file name
This is the file name I got

bundleresource://1806.fwk1492980244/projectFile/testfolder/actions/eol/call.eol
java.lang.IllegalArgumentException: URI scheme is not "file"

I am not sure, whats wrong with the file name, when calling as plugin project


Thanks,
Kanchan
Re: Querying UML file in EOL [message #1771755 is a reply to message #1771729] Wed, 30 August 2017 08:06 Go to previous message
Athanasios Zolotas is currently offline Athanasios ZolotasFriend
Messages: 52
Registered: November 2016
Location: York
Member
Hi Kanchan,

As far as I can tell this is not an Epsilon related problem. This SO post might be helpful. I would suggest you to google the error you receive and check the top results for the answer.

Regards,
Thanos
Previous Topic:EWL wizard in GMF editor not showing up after first usage
Next Topic:EMG
Goto Forum:
  


Current Time: Thu Apr 25 23:21:45 GMT 2024

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

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

Back to the top