|
| Re: [Xpand] Optimize succeeding workflow calls [message #540823 is a reply to message #540774] |
Thu, 17 June 2010 08:56   |
Sven Efftinge Messages: 1667 Registered: July 2009 |
Senior Member |
|
|
I think it would be best not to use the old mwe in this case, but
directly call Xpand (through XpandFacade).
If you release the ExecutionContext, i.e. create a new one on each
invocation the caches will be empty.
Sven
Ludwig Straub schrieb:
> Hello,
>
> I am using the org.eclipse.emf.mwe.core.WorkflowRunner class to execute
> a workflow and generate text via Xpand.
>
> This class offers two methods:
> * prepare
> * executeWorkflow
>
> In my situation, I want to execute the same workflow multiple times.
> In order to gain performance, I intend to call "prepare" only once and
> then call "executeWorkflow" multiple times.
> (But this seems not possible out of the box. Should it?)
>
> As input I pass the same EMF model instance (created via Xtext) via
> slot. The model contents however changes from call to call, as the user
> enters new data in the Xtext-Editor.
>
> In order to achieve this, I have to clear/reset the internal memory
> (hashtable?) where data is stored concerning the results of
> Xtend-methods marked with the keywords "create" or "cached".
>
> Is there a way to reset this storage manually or perhaps a flag you can
> set before calling executeWorkflow?
>
> Any help is appreciated :)
>
> Note:
> I came across another problem but was able to avoid it:
> The Xpand-Component throws exceptions as it tries to register the same
> outlets again and again each call of "invoke".
>
> Kind regards
> Ludwig
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
| Re: [Xpand] Optimize succeeding workflow calls [message #541047 is a reply to message #540846] |
Fri, 18 June 2010 03:31   |
Sven Efftinge Messages: 1667 Registered: July 2009 |
Senior Member |
|
|
Ludwig Straub schrieb:
> Thank you for the quick answer and the hint.
>
> The old mwe workflow contains quite a few other components beside the
> Xpand-Component.
>
> Also ist should be callable via command line.
>
> Therefore a drawback to use the XpandFacade is not ideal for the situation.
>
> An upgrade to mwe2 however would be possible.
MWE2 won't solve the problem, since it is not related to mwe but to Xpand.
Xpand uses a so called ExecutionContext and the Workflow component
written for Xpand creates one once and not on each call a new one,
you'll have to patch that.
Can be done by creating a subclass and overrideing the respective methods.
Sven
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
|
|
|
|
Powered by
FUDForum. Page generated in 0.01838 seconds