Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:51 Go to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 15:54 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 15:54 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
the workflow will not work if your FamilyDeclaration dont have a name attribute (directly or calculated via iqualifiednameprovider)

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 16:05 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 16:08]

Report message to a 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 16:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
https://christiandietrich.wordpress.com/2011/07/16/iqualifiednameproviders-in-xtext-2-0/

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 16:11 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 16:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
please share your complete solution (QualifiedNameprovider and adaption of yourdslruntimemodule)

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 17:13 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member

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 17:17 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
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)


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 17:35 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
it should be thier ?
  • Attachment: gen.png
    (Size: 15.94KB, Downloaded 109 times)

[Updated on: Mon, 21 March 2016 17:36]

Report message to a 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 17:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
no - inside src.

src-gen is for generated stuff only. not for generatedonce/manual code


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 23:30 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
i don't unrestand why i have this error

[Updated on: Mon, 21 March 2016 23:31]

Report message to a 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 23:45 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 06:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
Yes in this Stone Age version the api was different and the return type was string not qualified name

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727424 is a reply to message #1727313] Wed, 23 March 2016 00:17 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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: Wed, 23 March 2016 00:26]

Report message to a moderator

Re: Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' i [message #1727425 is a reply to message #1727424] Wed, 23 March 2016 00:20 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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] Wed, 23 March 2016 00:21 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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: Wed, 23 March 2016 00:37]

Report message to a 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 07:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
Should be

String qualifiedName(FamilyDecl decl){ ....



Use the debugger the the qualified name provider and its superclass


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 09:52 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 09:58 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 10:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
as i said. if i remember correctly it is/was

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

}


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 11:04 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
when i generate the DSl i don't have result the class MyDslQNP .that what i have

[Updated on: Wed, 23 March 2016 11:09]

Report message to a 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 11:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
Hi,

i do not understand this question. the qualifiednameprovider i a class you create manually


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 11:14 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 11:14 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
Can you share all needed to reproduce this.

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
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 11:24 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 11:41 Go to previous messageGo to next message
salha salha is currently offline salha salhaFriend
Messages: 97
Registered: February 2016
Member
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 11:55 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14083
Registered: July 2009
Senior Member
Have a look at the parent class. It uses a so called polymorphic dispatcher to determine the method to call

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:EMF and Gradle
Next Topic:Building with Maven
Goto Forum:
  


Current Time: Thu Oct 28 05:33:05 GMT 2021

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

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

Back to the top