Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Parameter Initialization(Unable to set the initial value of a discoverer parameter)
Parameter Initialization [message #1065076] Mon, 24 June 2013 09:04 Go to next message
Florian Grolleau is currently offline Florian GrolleauFriend
Messages: 2
Registered: June 2013
Junior Member
Hi all,

I am trying to create a new Java Discoverer. I created a Discoverer extending AbstractDiscoverJavaModelFromProject. I would like to initialize the parameter ELEMENTS_TO_ANALYZE. I create a static method with the annotation @ParameterInitialValue in order to initialize the value.

Unfortunately, this method is never called and the ELEMENTS_TO_ANALYZE parameter is always null.

public class MyJavaDiscoverer extends
AbstractDiscoverJavaModelFromProject<IProject> {

	@ParameterInitialValue(name = "ELEMENTS_TO_ANALYZE")
	public static ElementsToAnalyze getElementsToAnalyzeInitialValue(final IProject project) {
           ...
	}
}


Did I forget anything ?

Regards,
Florian
Re: Parameter Initialization [message #1065354 is a reply to message #1065076] Tue, 25 June 2013 11:58 Go to previous messageGo to next message
Guillaume Doux is currently offline Guillaume DouxFriend
Messages: 56
Registered: July 2009
Member
Hi,

This annotation is not written to be used when you launch a discoverer programmaticaly, this kind of annotations are used by the GUI to now which are the parameters that need to be asked to the end user of modisco.

If you want to launch your java discoverer on an IProject iproject you shoud do something like:

 youJavaDiscovererInstance.discoverElement(iproject, new NullProgressMonitor());

of course it should be done only after initializing all the other needed parameters using the correct setters.

I hope it will help you.

Best regards,

Guillaume



Re: Parameter Initialization [message #1065423 is a reply to message #1065354] Tue, 25 June 2013 16:12 Go to previous messageGo to next message
Florian Grolleau is currently offline Florian GrolleauFriend
Messages: 2
Registered: June 2013
Junior Member
Hi,

In fact, I use my discoverer from the GUI. I declared an extension from the extension point org.eclipse.modisco.infra.discovery.ui.discoverer.

My discoverer is identical to the discoverer DiscoverJavaModelFromProject (org.eclipse.modisco.java.discoverer). The only difference between this discoverer and my discoverer is in the saveTargetModel() method where I transform the java model into my model before persisting it.

I need the initialization of the ELEMENTS_TO_ANALYZE parameter in order to display the JavaElementsToAnalyzeDialog for dependencies selection.

I tried to extends the DiscoverJavaModelFromProject but I encountered the same issue. It is very weird because I am able to add parameter with @Parameter.

Any idea ?

Regards
Florian
Re: Parameter Initialization [message #1065548 is a reply to message #1065423] Wed, 26 June 2013 12:53 Go to previous message
Guillaume Doux is currently offline Guillaume DouxFriend
Messages: 56
Registered: July 2009
Member
Hi,

Sorry, I wasn't understanding what you were wanting to do.

Maybe it's just a stupid question but what append if you override just the saveTargetModel method and just use the getElementsToAnalyzeInitialValue method from the inherited class (without overriding) ?

In fact I don't really know where this getElementsToAnalyzeInitialValue is called in the java discoverer, I have searched for it and did not find it...

So I think I'm out of ideas.

Regards,

Guillaume

Previous Topic:Modisco & Papyrus don't generate UML
Next Topic:MoDisco in Kepler
Goto Forum:
  


Current Time: Sat Apr 20 00:48:18 GMT 2024

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

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

Back to the top