Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-user] Problem accessing single nodes of a matchinhenshin

You’re using the wrong factory J The factory you’re after, is probably a simple XMIResourceFactory, which would typically be registered against a ‘*’ extension catchall.

 

Steffen

 

Dr. rer. nat. Steffen Zschaler AHEA

Senior Lecturer

 

King's College London

Department of Informatics

 

Email szschaler@xxxxxxx

Phone +44 (020) 7848 1513

WWW   http://www.steffen-zschaler.de/

 

From: henshin-user-bounces@xxxxxxxxxxx [mailto:henshin-user-bounces@xxxxxxxxxxx] On Behalf Of Florian Kunz
Sent: 28 August 2018 09:36
To: Henshin Project user discussions <henshin-user@xxxxxxxxxxx>
Subject: Re: [henshin-user] Problem accessing single nodes of a matchinhenshin

 

Hi all,

 

after I have continued with my project and started to learn how to use Sirius, I face another, for you most probably trivial problem.

I created a model with Sirius with a custom ending (for example .basicfamily from the Sirius tutorial) but I can’t find a way, to use this model with Henshin.

 

I copied the model into a project in the first instance of eclipse. There I try to load it with the following line:

EGraph graph = new EGraphImpl(resourceSet.getResource("example.basicfamily"));

 

But this throws the exception:

Cannot create a resource for 'example.basicfamily'; a registered resource factory is needed

 

Through some searching I learned, that I have to load the resource factory mentioned in the plugin.xml from the edit project. So I added the following line before the instantiation of the EGraph:

 

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("basicfamily", new org.eclipse.sirius.sample.basicfamily.provider.BasicfamilyItemProviderAdapterFactory());

 

This results in another exception:

org.eclipse.sirius.sample.basicfamily.provider.BasicfamilyItemProviderAdapterFactory cannot be cast to org.eclipse.emf.ecore.resource.Resource$Factory

 

Sadly I have no idea how to solve this problem.

 

Best regards,

Florian


Back to the top