Home » Archived » GMT (Generative Modeling Technologies) » [oaw] Problem invoking JavaMetamodel from plugin
[oaw] Problem invoking JavaMetamodel from plugin [message #375678] |
Wed, 13 December 2006 08:48  |
Eclipse User |
|
|
|
Originally posted by: tobiasbuhr.gmx.de
Hi all,
I try to invoke a workflow from a eclipse plugin via
WorkflowRunner.run(). All types, that are some kind of
<metaModel id="mm_my"
class="org.openarchitectureware.type.emf.EmfMetaModel">
<metaModelPackage value="my.MyPackage"/>
</metaModel>
are recognized correctly, but self created Java-Classes, that I try to
access with the JavaMetaModel
<metaModel id="mm_java"
class="org.openarchitectureware.type.impl.java.JavaMetaModel "/>
are not recognized:
---
2212 [main] ERROR org.openarchitectureware.workflow.WorkflowRunner -
Couldn't resolve type for 'mypackage::MyObject'. Did you forget to
configure the corresponding metamodel?:in my.ext on line 24 'Boolean
doSomething(mypackage::MyObject o)'
org.openarchitectureware.expression.EvaluationException: Couldn't
resolve type for 'mypackage::MyObject'. Did you forget to configure the
corresponding metamodel?:in my.ext on line 24 'Boolean
doSomething(mypackage::MyObject o)' at
org.openarchitectureware.xtend.ast.Extension.init(Extension. java:145)
---
If I start the workflow in the Eclipse-Platform via "Run ->
WorkflowRunner" everything goes fine.
Examining the executed WorkflowRunner.main() method, I took a look at
the resource loaders. I played around a little with them, but I did not
get it right (main method uses ResourceLoaderDefaultImpl but if I do so,
oaw stuff won't be found). Currently (with all non JavaMetamodels beeing
recognized correctly), I have to use the follwing line for having all
stuff (oaw, metamodels) loaded correctly (as it was posted often here):
ResourceLoaderFactory.setCurrentThreadResourceLoader(new
ResourceLoaderImpl(getClass().getClassLoader()));
---
Does anybody know something (loading own resources correctly, how to use
JavaMetaModels from own code)???
Thanks, Tobias
|
|
|
Re: [oaw] Problem invoking JavaMetamodel from plugin [message #375682 is a reply to message #375678] |
Mon, 18 December 2006 02:46   |
Eclipse User |
|
|
|
Hi Tobias,
Java classes need to be accessible through your classloader.
I assume you tried to use a class contained in your eclipse project?
Those classes are not in classpath of the eclipse runtime.
In order to start such a workflow you need to use the launch API.
I don't know how to invoke it programmatically (we use the extension point).
hope that helps,
Sven
Tobias Buhr wrote:
> Hi all,
>
> I try to invoke a workflow from a eclipse plugin via
> WorkflowRunner.run(). All types, that are some kind of
>
> <metaModel id="mm_my"
> class="org.openarchitectureware.type.emf.EmfMetaModel">
> <metaModelPackage value="my.MyPackage"/>
> </metaModel>
>
> are recognized correctly, but self created Java-Classes, that I try to
> access with the JavaMetaModel
>
> <metaModel id="mm_java"
> class="org.openarchitectureware.type.impl.java.JavaMetaModel "/>
>
> are not recognized:
>
> ---
>
> 2212 [main] ERROR org.openarchitectureware.workflow.WorkflowRunner -
> Couldn't resolve type for 'mypackage::MyObject'. Did you forget to
> configure the corresponding metamodel?:in my.ext on line 24 'Boolean
> doSomething(mypackage::MyObject o)'
> org.openarchitectureware.expression.EvaluationException: Couldn't
> resolve type for 'mypackage::MyObject'. Did you forget to configure the
> corresponding metamodel?:in my.ext on line 24 'Boolean
> doSomething(mypackage::MyObject o)' at
> org.openarchitectureware.xtend.ast.Extension.init(Extension. java:145)
>
> ---
>
> If I start the workflow in the Eclipse-Platform via "Run ->
> WorkflowRunner" everything goes fine.
>
> Examining the executed WorkflowRunner.main() method, I took a look at
> the resource loaders. I played around a little with them, but I did not
> get it right (main method uses ResourceLoaderDefaultImpl but if I do so,
> oaw stuff won't be found). Currently (with all non JavaMetamodels beeing
> recognized correctly), I have to use the follwing line for having all
> stuff (oaw, metamodels) loaded correctly (as it was posted often here):
>
> ResourceLoaderFactory.setCurrentThreadResourceLoader(new
> ResourceLoaderImpl(getClass().getClassLoader()));
>
> ---
>
> Does anybody know something (loading own resources correctly, how to use
> JavaMetaModels from own code)???
>
> Thanks, Tobias
|
|
|
Re: [oaw] Problem invoking JavaMetamodel from plugin [message #375685 is a reply to message #375682] |
Tue, 19 December 2006 06:20  |
Eclipse User |
|
|
|
Originally posted by: tobiasbuhr.gmx.de
Sven Efftinge wrote:
> Java classes need to be accessible through your classloader.
> I assume you tried to use a class contained in your eclipse project?
> Those classes are not in classpath of the eclipse runtime.
>
> In order to start such a workflow you need to use the launch API.
> I don't know how to invoke it programmatically (we use the extension
> point).
thanks Sven, the way you described, it works :-)
WorkflowLaunchShortcut workflowLaunchShortcut = new
WorkflowLaunchShortcut();
workflowLaunchShortcut.launch(currentSelection, "run");
where currentSelection is one on a workflow file.
Thus I want to programmatically set up the input model file, and need
the result of the transformation in memory for further processing, it
will get little ugly I think.. (have to pass it back via extension that
wraps java method)
Nevertheless, I am happy to invoke oaw ;-) from my plugin now,
best regards, Tobias
(copy to openarchitecureware.org forum)
|
|
|
Re: [oaw] Problem invoking JavaMetamodel from plugin [message #560581 is a reply to message #375678] |
Mon, 18 December 2006 02:46  |
Eclipse User |
|
|
|
Hi Tobias,
Java classes need to be accessible through your classloader.
I assume you tried to use a class contained in your eclipse project?
Those classes are not in classpath of the eclipse runtime.
In order to start such a workflow you need to use the launch API.
I don't know how to invoke it programmatically (we use the extension point).
hope that helps,
Sven
Tobias Buhr wrote:
> Hi all,
>
> I try to invoke a workflow from a eclipse plugin via
> WorkflowRunner.run(). All types, that are some kind of
>
> <metaModel id="mm_my"
> class="org.openarchitectureware.type.emf.EmfMetaModel">
> <metaModelPackage value="my.MyPackage"/>
> </metaModel>
>
> are recognized correctly, but self created Java-Classes, that I try to
> access with the JavaMetaModel
>
> <metaModel id="mm_java"
> class="org.openarchitectureware.type.impl.java.JavaMetaModel "/>
>
> are not recognized:
>
> ---
>
> 2212 [main] ERROR org.openarchitectureware.workflow.WorkflowRunner -
> Couldn't resolve type for 'mypackage::MyObject'. Did you forget to
> configure the corresponding metamodel?:in my.ext on line 24 'Boolean
> doSomething(mypackage::MyObject o)'
> org.openarchitectureware.expression.EvaluationException: Couldn't
> resolve type for 'mypackage::MyObject'. Did you forget to configure the
> corresponding metamodel?:in my.ext on line 24 'Boolean
> doSomething(mypackage::MyObject o)' at
> org.openarchitectureware.xtend.ast.Extension.init(Extension. java:145)
>
> ---
>
> If I start the workflow in the Eclipse-Platform via "Run ->
> WorkflowRunner" everything goes fine.
>
> Examining the executed WorkflowRunner.main() method, I took a look at
> the resource loaders. I played around a little with them, but I did not
> get it right (main method uses ResourceLoaderDefaultImpl but if I do so,
> oaw stuff won't be found). Currently (with all non JavaMetamodels beeing
> recognized correctly), I have to use the follwing line for having all
> stuff (oaw, metamodels) loaded correctly (as it was posted often here):
>
> ResourceLoaderFactory.setCurrentThreadResourceLoader(new
> ResourceLoaderImpl(getClass().getClassLoader()));
>
> ---
>
> Does anybody know something (loading own resources correctly, how to use
> JavaMetaModels from own code)???
>
> Thanks, Tobias
|
|
|
Re: [oaw] Problem invoking JavaMetamodel from plugin [message #560586 is a reply to message #375682] |
Tue, 19 December 2006 06:20  |
Eclipse User |
|
|
|
Originally posted by: tobiasbuhr.gmx.de
Sven Efftinge wrote:
> Java classes need to be accessible through your classloader.
> I assume you tried to use a class contained in your eclipse project?
> Those classes are not in classpath of the eclipse runtime.
>
> In order to start such a workflow you need to use the launch API.
> I don't know how to invoke it programmatically (we use the extension
> point).
thanks Sven, the way you described, it works :-)
WorkflowLaunchShortcut workflowLaunchShortcut = new
WorkflowLaunchShortcut();
workflowLaunchShortcut.launch(currentSelection, "run");
where currentSelection is one on a workflow file.
Thus I want to programmatically set up the input model file, and need
the result of the transformation in memory for further processing, it
will get little ugly I think.. (have to pass it back via extension that
wraps java method)
Nevertheless, I am happy to invoke oaw ;-) from my plugin now,
best regards, Tobias
(copy to openarchitecureware.org forum)
|
|
|
Goto Forum:
Current Time: Wed May 07 00:19:23 EDT 2025
Powered by FUDForum. Page generated in 0.08152 seconds
|