Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 313776 - Querying of metamodel file crashes if metamodel doesn't exist
Summary: Querying of metamodel file crashes if metamodel doesn't exist
Status: NEW
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dimitris Kolovos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-20 13:13 EDT by Chris Holmes CLA
Modified: 2012-02-06 10:59 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Holmes CLA 2010-05-20 13:13:19 EDT
If the following command is executed on a non-existant metamodel the task will crash:
I run the following from the 'pre' section of a working ETL file:
  -- some diagnostics
  'Source model:'.println();
  ('Source:         ' + Source).println();
  ('EMF model:      ' + Source.target).println();
  'Target model:'.println();
  ('Target:         ' + Target).println();
  ('EMF model:      ' + Target.target).println();
  ('Location:       ' + Target.target.modelFile).println();
  ('Metamodel URI:  ' + Target.target.metamodelUri).println();
  ('Metamodel file: ' + Target.target.metamodelFile).println();

I receive the following output and error message:
Source model:
Source:         org.eclipse.epsilon.workflow.tasks.ModelReference@99c2aa
EMF model:      org.eclipse.epsilon.emc.emf.xml.XmlModel@bb4c22
Target model:
Target:         org.eclipse.epsilon.workflow.tasks.ModelReference@8380df
EMF model:      org.eclipse.epsilon.emc.emf.EmfModel@181b9f7
Location:       C:\EclipseWorkspaces\blah...\MyStuff.model
Metamodel URI:  http://blah../MyStuff
EXCEPTION: Internal error: java.lang.reflect.InvocationTargetException

Notes:
As you're loading the model by metamodel URI, metamodelFile is null and this causes an exception. Could you please add another bug report for this? Until we get this fixed you can get the raw URI of the metamodel file (which will also be null in this case but won't throw an exception) using:

('Metamodel file: ' + Target.target.metamodelFileUri).println();

On a side note, Target.target.xxx will only work when you're launching the transformation through ANT. If at some point you invoke the ETL transformation from Java/launch configuration there'll be no ModelReference so all calls to Target.target.xxx will need to be replaced by Target.xxx.