Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' is em
Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' is em [message #1727261] Mon, 21 March 2016 11:51 Go to next message
Eclipse UserFriend
i have this error when i generate my workflow a have this error
0 [main] DEBUG org.eclipse.xtext.mwe.Reader - Resource Pathes : [src/model]
10 [main] INFO org.eclipse.xpand2.Generator - No meta models configured, using JavaBeans as default.
1121 [main] DEBUG xt.validation.ResourceValidatorImpl - Syntax check OK! Resource: file:/C:/Users/mabrouk/Desktop/Nouveau%20dossier%20(2)/eclipsehelio%20avec%20atl/workspace/org.xtext.acme.generator/src/model/Example.acme
1744 [main] WARN org.eclipse.xtext.mwe.SlotEntry - Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' is empty.
1829 [main] INFO .emf.mwe2.runtime.workflow.Workflow - Done.
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727263 is a reply to message #1727261] Mon, 21 March 2016 11:54 Go to previous messageGo to next message
Eclipse UserFriend
this is the workfllow :
Workflow {

component = org.eclipse.xtext.mwe.Reader {
// lookup all resources on the classpath
// useJavaClassPath = true

// or define search scope explicitly
path = modelPath

// this class will be generated by the xtext generator
register = org.xtext.example.mydsl.MyDslStandaloneSetup {}
load = {

slot = "familyDeclaration"
type = "FamilyDeclaration"
}
}


component = org.eclipse.xpand2.Generator {
expand = "templates::Template::main FOREACH familyDeclaration"
outlet = {
path = targetDir
}
fileEncoding = fileEncoding
}
component = org.eclipse.emf.mwe.utils.Writer{
modelSlot ="familyDeclaration"
uri ="${targetDir}/acme.xmi"}
}
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727264 is a reply to message #1727261] Mon, 21 March 2016 11:54 Go to previous messageGo to next message
Eclipse UserFriend
the workflow will not work if your FamilyDeclaration dont have a name attribute (directly or calculated via iqualifiednameprovider)
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727265 is a reply to message #1727264] Mon, 21 March 2016 12:05 Go to previous messageGo to next message
Eclipse UserFriend
who i declarate the class iqualifiednameprovider?

ACME_ARMANI:{ACME_ARMANI}
(familyDeclaration=FamilyDeclaration system=SystemDeclaration)?;



FamilyDeclaration:{FamilyDeclaration}
'Family' nomFamily=ID '='('{')? familyBody=FamilyBody ('}')?(';')?;

FamilyBody: {FamilyBody}
(typeDeclaration+=TypeDeclaration)*;

[Updated on: Mon, 21 March 2016 12:08] by Moderator

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727266 is a reply to message #1727265] Mon, 21 March 2016 12:06 Go to previous messageGo to next message
Eclipse UserFriend
https://christiandietrich.wordpress.com/2011/07/16/iqualifiednameproviders-in-xtext-2-0/
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727269 is a reply to message #1727266] Mon, 21 March 2016 12:11 Go to previous messageGo to next message
Eclipse UserFriend
i try this but QualifiedName.create not work ?
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727271 is a reply to message #1727269] Mon, 21 March 2016 12:18 Go to previous messageGo to next message
Eclipse UserFriend
please share your complete solution (QualifiedNameprovider and adaption of yourdslruntimemodule)
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727279 is a reply to message #1727271] Mon, 21 March 2016 13:13 Go to previous messageGo to next message
Eclipse UserFriend

where to put the two class QualifiedNameprovider and MyDslRuntimeModule ?
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727281 is a reply to message #1727279] Mon, 21 March 2016 13:17 Go to previous messageGo to next message
Eclipse UserFriend
there is a mydslruntime module already (in 2.9.x it might happen to be a xtend file)
put the nameprovider somewhere in the same project at a package of your choice (probably ...yourdsl.naming might be a good place)
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727284 is a reply to message #1727281] Mon, 21 March 2016 13:35 Go to previous messageGo to next message
Eclipse UserFriend
it should be thier ?
  • Attachment: gen.png
    (Size: 15.94KB, Downloaded 179 times)

[Updated on: Mon, 21 March 2016 13:36] by Moderator

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727286 is a reply to message #1727284] Mon, 21 March 2016 13:41 Go to previous messageGo to next message
Eclipse UserFriend
no - inside src.

src-gen is for generated stuff only. not for generatedonce/manual code
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727305 is a reply to message #1727286] Mon, 21 March 2016 19:30 Go to previous messageGo to next message
Eclipse UserFriend
i don't unrestand why i have this error

[Updated on: Mon, 21 March 2016 19:31] by Moderator

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727306 is a reply to message #1727305] Mon, 21 March 2016 19:45 Go to previous messageGo to next message
Eclipse UserFriend
the version of xtext is
Version: 1.0.2.v201102150722
not 2.0
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727313 is a reply to message #1727306] Tue, 22 March 2016 02:24 Go to previous messageGo to next message
Eclipse UserFriend
Yes in this Stone Age version the api was different and the return type was string not qualified name
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727424 is a reply to message #1727313] Tue, 22 March 2016 20:17 Go to previous messageGo to next message
Eclipse UserFriend
i change it but i have the same problem !!
Quote:

import org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider;

import org.xtext.example.mydsl.myDsl.FamilyDeclaration;




public class MyDslQNP extends DefaultDeclarativeQualifiedNameProvider {
public String getQualifiedName(FamilyDeclaration unit) {
return unit.getNomFamily();
}

}

Quote:

import org.eclipse.xtext.naming.IQualifiedNameProvider;

/**
* Use this class to register components to be used at runtime / without the Equinox extension registry.
*/
public class MyDslRuntimeModule extends org.xtext.example.mydsl.AbstractMyDslRuntimeModule {

@Override
public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
return MyDslQNP.class;
}

}

[Updated on: Tue, 22 March 2016 20:26] by Moderator

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727425 is a reply to message #1727424] Tue, 22 March 2016 20:20 Go to previous messageGo to next message
Eclipse UserFriend
and this is the workfllow:
Workflow {

	component = org.eclipse.xtext.mwe.Reader {
		// lookup all resources on the classpath
		// useJavaClassPath = true

		// or define search scope explicitly
		path = modelPath

		// this class will be generated by the xtext generator 
		register = org.xtext.example.mydsl.MyDslStandaloneSetup {}
		load = {
			
			slot = "familyDeclaration"
			type = "FamilyDeclaration"
		}
	}

	
	component = org.eclipse.xpand2.Generator {
		expand = "templates::Template::main FOREACH familyDeclaration"
		outlet = {
			path = targetDir
		}
		fileEncoding = fileEncoding
	}
	component = org.eclipse.emf.mwe.utils.Writer{
       modelSlot ="familyDeclaration"
       uri ="${targetDir}/acme.xmi"}
}

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727426 is a reply to message #1727425] Tue, 22 March 2016 20:21 Go to previous messageGo to next message
Eclipse UserFriend
this is a part of DSL:
FamilyDeclaration:{FamilyDeclaration}
	'Family' nomFamily=ID '='('{')? familyBody=FamilyBody ('}')?(';')?;

FamilyBody: {FamilyBody}
	 (typeDeclaration+=TypeDeclaration)*;

TypeDeclaration:{TypeDeclaration}
	elementTypeDeclaration=ElementTypeDeclaration | propertyTypeDeclaration=PropertyTypeDeclaration
	;
......

and this an exemple of model :
Family PipeFilterFam = {
 Component Type FilterT = {
 Ports { stdin ; stdout; };
 Property throughput : int;
 };
 Component Type UnixFilterT extends FilterT with {
 Port stderr ;
 Property implementationFile : String;
 };
 Connector Type PipeT = {
 Roles { source; sink; };
 Property bufferSize : int ;
 };
 Property Type StringMsgFormatT = Record [ size:int; msg:String; ];
 Invariant Forall c in self .Connectors | HasType(c, PipeT);
 }
  
 }
     


[Updated on: Tue, 22 March 2016 20:37] by Moderator

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727436 is a reply to message #1727426] Wed, 23 March 2016 03:12 Go to previous messageGo to next message
Eclipse UserFriend
Should be

String qualifiedName(FamilyDecl decl){ ....



Use the debugger the the qualified name provider and its superclass
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727471 is a reply to message #1727436] Wed, 23 March 2016 05:52 Go to previous messageGo to next message
Eclipse UserFriend
that is what i do !!
public class MyDslQNP extends DefaultDeclarativeQualifiedNameProvider {
public String getQualifiedName(FamilyDeclaration unit) {
return unit.getNomFamily();
}

}
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727473 is a reply to message #1727471] Wed, 23 March 2016 05:58 Go to previous messageGo to next message
Eclipse UserFriend
please any help
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727479 is a reply to message #1727473] Wed, 23 March 2016 06:29 Go to previous messageGo to next message
Eclipse UserFriend
as i said. if i remember correctly it is/was

public class MyDslQNP extends DefaultDeclarativeQualifiedNameProvider {
public String qualifiedName(FamilyDeclaration unit) {
return unit.getNomFamily();
}

}
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727490 is a reply to message #1727479] Wed, 23 March 2016 07:04 Go to previous messageGo to next message
Eclipse UserFriend
when i generate the DSl i don't have result the class MyDslQNP .that what i have

[Updated on: Wed, 23 March 2016 07:09] by Moderator

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727491 is a reply to message #1727490] Wed, 23 March 2016 07:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

i do not understand this question. the qualifiednameprovider i a class you create manually
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727494 is a reply to message #1727491] Wed, 23 March 2016 07:14 Go to previous messageGo to next message
Eclipse UserFriend
yes that what i do i add a image in the last msg
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727495 is a reply to message #1727494] Wed, 23 March 2016 07:14 Go to previous messageGo to next message
Eclipse UserFriend
Can you share all needed to reproduce this.
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727498 is a reply to message #1727495] Wed, 23 March 2016 07:24 Go to previous messageGo to next message
Eclipse UserFriend
it work thanks a lottttttttttttttttttttttttttt
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727502 is a reply to message #1727498] Wed, 23 March 2016 07:41 Go to previous messageGo to next message
Eclipse UserFriend
just i have question why i should put qualifiednameprovider and not getQualifiednameprovider it's a name of class i know that we can use any thing with name of class??
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727504 is a reply to message #1727502] Wed, 23 March 2016 07:55 Go to previous message
Eclipse UserFriend
Have a look at the parent class. It uses a so called polymorphic dispatcher to determine the method to call
Previous Topic:EMF and Gradle
Next Topic:Building with Maven
Goto Forum:
  


Current Time: Wed Jul 23 01:46:59 EDT 2025

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

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

Back to the top