Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jwt-dev] Re: A question about extension custom model in JWT

Hi Kim

I can see that you've had a look at the source code ;)

In WEEditor (see http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jwt/we/jwt-we/src/org/eclipse/jwt/we/editors/WEEditor.java?annotate=1.61&root=Technology_Project ), the workflow model is loaded at line 1354 : mainModelResource = getEmfEditingDomain().getResourceSet().getResource(resourceUri, true);

As you can see, model loading is entirely delegated to EMF's getResource(). So as long as the EMF registry knows your model, you'll be OK.

For the EMF registry to know your model, you have to use the right EMF extension point in your plugin.xml . For example, in the said aspectschildextender sample :
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jwt/we/jwt-we-plugins/jwt-we-sample-aspectschildextender/plugin.xml?view=markup&root=Technology_Project
you can see that it uses EMF generated classes through the "org.eclipse.emf.ecore.generated_package" extension point.

Note that the EPC sample uses a mix of EMF extension and JWT Aspects extension, through a conf/*.conf file and the "org.eclipse.jwt.we.conf.model.conf" extension point.

Regards,
Marc

Kim Nguyen a écrit :
Hi Marc,

Well, actually is the EPC plugin, which loads its own model exactly the solution what we need. But I couldn't find the information how the JWT (WEEditor) loads the model from EPC plugin :(
(Or do I missed some thing here?)

Best regards,

Kim


> Date: Wed, 18 Aug 2010 10:29:28 +0200
> From: marc.dutoo@xxxxxxxxxxx
> To: kimnguyen@xxxxxxxxxx
> CC: jwt-dev@xxxxxxxxxxx
> Subject: Re: A question about extension custom model in JWT
>
> Hi Kim
>
> JWT Editors are EMF based, so they will use your EMF plugin if it is
> made available (ex. in the workspace and you use the "run as eclipse
> application" way of starting JWT).
>
> There is a sample plugin at
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jwt/we/jwt-we-plugins/jwt-we-sample-aspectschildextender/?root=Technology_Project
> & .edit , it probably is obsolete and doesn't work anymore but it
> should give you ideas.
>
> Regards,
> Marc
>
>
> Kim Nguyen a écrit :
> > Hi Marc,
> >
> > thank you very much :). I created the .model and .edit plugin now. In
> > 'MyTmworkflowItemProviderAdapterFactory' I have one
> > ChildCreationExtender in it. With the
> > 'org.eclipse.emf.edit.childCreationExtenders' extension point I
> > defined one extender from my TmworkflowItemProviderAdapterFactory.
> > With which extension point could I say, that the editor has to work
> > with new model now? I could find that information on the wiki :(
> >
> > Thank you in advance
> >
> > Kim
> >
> >
> > > Date: Tue, 17 Aug 2010 15:01:40 +0200
> > > From: marc.dutoo@xxxxxxxxxxx
> > > To: kimnguyen@xxxxxxxxxx
> > > CC: jwt-dev@xxxxxxxxxxx
> > > Subject: Re: A question about extension custom model in JWT
> > >
> > > Hi Kim
> > >
> > > Welcom to the Java Workflow Tooling community !
> > >
> > > I urge to send your questions to the mailing list ( Java Workflow
> > > Toolbox <jwt-dev@xxxxxxxxxxx> ), so everyone can see them.
> > >
> > > As I understand, you are using EMF to extend the model rather than
> > JWT's
> > > Aspects model extensions. So the following excerpts of
> > > http://wiki.eclipse.org/JWT_Metamodel_Extension apply in your case :
> > >
> > > "
> > >
> > > * extend an existing type of the model with your own type. This is
> > > only interesting to create well identified subtypes, i.e. that
> > > could have been provided in the base model beforehand. If it is
> > > the case, please consider contributing it to JWT's core metamodel.
> > > To enable child extenders, extensibleProviderFactory="true" has to
> > > be set on the genModel package of the EMF class you want to extend
> > > (OK for jwt-we-conf-model, TODO 20100112 regenerate JWT
> > > metamodel), and on your side you have to set
> > > childCreationExtenders="true" on the genModel package of your
> > > extending EMF class. See an example in
> > > jwt-we-plugins/jwt-we-sample-aspectchildextenders and Ed Merks'
> > > blog at
> > >
> > http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html
> > > .
> > >
> > >
> > > "
> > >
> > > Hoping this last link will help you.
> > >
> > > Regards,
> > > Marc
> > >
> > >
> > > Kim Nguyen a écrit :
> > > > Hi Marc,
> > > >
> > > > Sorry that I sent the email twice, I just clicked on wrong button :(
> > > >
> > > > We are currently developing a RCP application, which use the JWT to > > > > allow user create workflows. We use all the function of JWT Editor,
> > > > except that we need to extends a custom modell.
> > > > I found in forum the exactly problem, which we have too.
> > > >
> > > > See that topic:
> > > >
> > http://www.eclipse.org/forums/index.php?t=msg&th=156958&start=0&S=e16af7f7f131cc8b680d8351a62feb3c
> > > >
> > > > In that you suggested to see at EPC plugin.
> > > > We have defined our custom model with EMF like EPC plugin, some
> > > > element are inherited from standard jwt model elements.
> > > > How could I config that the editor work with the new model? In the
> > epc
> > > > plugin I couldn't see the such config.
> > > >
> > > > Could you help me please, we need urgently a solution and I couldn't
> > > > find the answer in internet
> > > >
> > > >
> > > > thank you in advance
> > > >
> > > > Kim
> > >


Back to the top