Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » AMP » Running models standalone
Running models standalone [message #560098] Tue, 21 September 2010 08:23 Go to next message
Oliver Mannion is currently offline Oliver MannionFriend
Messages: 31
Registered: September 2010
Member
Hi,

I'm just getting in AMP.

I have seen apps that run standalone using the eclipse GUI. Is it possible to turn a model into a such a standalone application (without the development functions)?

This is as opposed to having to run the model from within the same eclipse environment that development occurs.
Re: Running models standalone [message #618226 is a reply to message #560098] Tue, 21 September 2010 23:00 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Oliver Mannion wrote on Tue, 21 September 2010 04:23
Hi,

I'm just getting in AMP.

I have seen apps that run standalone using the eclipse GUI. Is it possible to turn a model into a such a standalone application (without the development functions)?

This is as opposed to having to run the model from within the same eclipse environment that development occurs.


Hi Oliver,

That's an interesting question. First as of course you know, you can deploy apps as Swing applications simply by creating an Ascape project and dragging the model over.

re: Eclipse hosted models, that should be totally doable. The idea here would be to have an Eclipse RCP application that simply supported the model that you had just created perhaps with the project explorer bundled so that you would have a place to organize output data, etc.. This is all very straightforward. However... with eclipse "straightforward" doesn't (hardly?) ever mean "easy". But perhaps we'd be surprised and it would be easy.

Eventually it would be nice to have some sort of wizard to deploy such things. But if you want to try to do this on your own, here's a basic plan..

1. Read up on on building RCP products -- its very helpful to go through a tutorial -- Lars Vogella has an excellent one here: http://www.vogella.de/articles/EclipseRCP/article.html
2. Create a feature and product for your app. Include the escape, agf and axf features, but do *not* include the AMF stuff.
3. Hook up some way to launch the model -- you could just customize the existing handlers pretty easily I think to take a fixed model.
4. Fix stuff that goes wrong when you try 3. Smile
icon14.gif  Re: Running models standalone [message #619665 is a reply to message #618226] Wed, 22 September 2010 00:01 Go to previous messageGo to next message
Oliver Mannion is currently offline Oliver MannionFriend
Messages: 31
Registered: September 2010
Member
Thanks for the direction Miles! Smile That tutorial looks perfect. I will experiment with this. It would be great to have a distribution application that my users can just install and run without the extra development complexity.
Re: Running models standalone [message #632456 is a reply to message #618226] Wed, 13 October 2010 03:55 Go to previous messageGo to next message
Oliver Mannion is currently offline Oliver MannionFriend
Messages: 31
Registered: September 2010
Member
I'm trying to hook up some way of programmatically calling my escape java model.

I think that i need to instantiate a ExecuteJavaHandler and call

public final void execute(final Object executed, String name)

supplying it with a CompilationUnit object that represents my class in the project explorer, but how do I get the CompilationUnit to pass to execute? Or is this not the best way to do it??
Re: Running models standalone [message #632749 is a reply to message #618226] Thu, 14 October 2010 07:15 Go to previous messageGo to next message
Oliver Mannion is currently offline Oliver MannionFriend
Messages: 31
Registered: September 2010
Member
I think I might have to make a change to EsclipseEscapeRunner. In particular I am thinking of creating a version of

public void open(final IResource projectResource, final String modelClassName, String modelName, String[] args,
            boolean block) 


that will accept a project name instead of a projectResource. This is so I don't have to have a workspace with resources. Instead I'll specify the class name which will be a Scape existing in a plugin - i think this will work?
Re: Running models standalone [message #632977 is a reply to message #632749] Thu, 14 October 2010 21:04 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Oliver Mannion wrote on Thu, 14 October 2010 03:15
I think I might have to make a change to EsclipseEscapeRunner. In particular I am thinking of creating a version of

public void open(final IResource projectResource, final String modelClassName, String modelName, String[] args,
            boolean block) 


that will accept a project name instead of a projectResource. This is so I don't have to have a workspace with resources. Instead I'll specify the class name which will be a Scape existing in a plugin - i think this will work?


Yes, it makes sense but I can't be sure it will work out of the box -- we assume that we have a project elsewhere. In fact..

If you look at that method, it calls org.eclipse.amp.escape.ide.ProjectLoader. This of course currently requires a project, where it just grabs the path, so you could add something for that.. but! you don't actually need it all because it is doing dynamic class loading and we don't need that if we're launching a new runtime and we have the code as a plugin. IOTW, the current case is the hard case. So what actually needs to happen Wink is that the open should be refactored and the dynamic version added in. Or, I suppose you could create a flag for it instead.

I you want to make that change/addition to EsclipseEscapeRunner itself, then please feel free -- submit a patch and we'll get it in.
Re: Running models standalone [message #632980 is a reply to message #632977] Thu, 14 October 2010 21:08 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Miles Parker wrote on Thu, 14 October 2010 17:04
IOTW, the current case is the hard case. So what actually needs to happen Wink is that the open should be refactored and the dynamic version added in. Or, I suppose you could create a flag for it instead.


Um, it occurs to me that if you can solve this issue, you've solved this bug as well.. Very Happy

https://bugs.eclipse.org/bugs/show_bug.cgi?id=289394

Here we'd do it without the dynamic execution but that would be fine..if someone knows enough to be able to use a debugger, presumably they can handle launching a Java model directly..
Re: Running models standalone [message #637321 is a reply to message #632980] Fri, 05 November 2010 03:11 Go to previous messageGo to next message
Oliver Mannion is currently offline Oliver MannionFriend
Messages: 31
Registered: September 2010
Member
OK I made changes to EclipseEscapeRunner so loading a model from a Project is a specific case of loading from the name of a class (which now allows loading models from bundles).

I've also modified InfoView so it uses getResource instead of relying on a project to load the about file. This works for both models loaded from workspace projects and models run from bundles.

I've also created a new execute handler and command to load using just the name of the class (ie: for models in bundles).

How can I submit this as a patch?
Re: Running models standalone [message #637487 is a reply to message #637321] Fri, 05 November 2010 19:07 Go to previous messageGo to next message
Miles Parker is currently offline Miles ParkerFriend
Messages: 1341
Registered: July 2009
Senior Member
Oliver Mannion wrote on Thu, 04 November 2010 23:11

How can I submit this as a patch?


Wow Oliver, excellent thanks. If you right-click on the project, and select "Team", "Create Patch" that should get you the patch. Then, please open up a bugzilla, as a "Feature Request" with the Patch attached to it and described as above.

cheers,

Miles
Re: Running models standalone [message #638342 is a reply to message #637487] Wed, 10 November 2010 22:05 Go to previous message
Oliver Mannion is currently offline Oliver MannionFriend
Messages: 31
Registered: September 2010
Member
NB: Submitted as patch to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=329645
Previous Topic:Conflicting dependency when installing Ascape Documentation and Source
Next Topic:Project plan updated.
Goto Forum:
  


Current Time: Sat Nov 09 07:19:42 GMT 2024

Powered by FUDForum. Page generated in 0.04875 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top