2015-07-22 7 views
0

я получаю сообщение об ошибке: Acceleo оценка Исключения: Undefined «Пусть» выражение в строке .. в модуле ... для блока ...Acceleo Неопределенное «Пусть» выражение

Вот мой шаблон:

[comment encoding = UTF-8 /] 
[module generate('http://www.eclipse.org/emf/2002/Ecore', 'http://www.eclipse.org/emf/compare', 'http://www.workingmouse.com/mdsaas/featuremodel')] 

[template public generateElement(comparison : Comparison)] 
[comment @main/] 
[file ('update.sql', false, 'UTF-8')] 
/*SQL UPDATE SCRIPT TEST*/ 
[for (difference : Diff | comparison.getDifferences())] 
    [let rc : ReferenceChange = difference.oclAsType(ReferenceChange)] 
     [let dc : DomainClass = rc.value.oclAsType(DomainClass)] 
[printTodo(difference.kind.toString(), 'DomainClass', dc.name.toString())/] 
     [elselet da : DomainAttribute = rc.value.oclAsType(DomainAttribute)] 
[printTodo(difference.kind.toString(), 'DomainAttribute', da.name.toString())/] 
     [elselet t : Tile = rc.value.oclAsType(Tile)] 
[printTodo(difference.kind.toString(), 'Tile', t.name.toString())/] 
     [elselet dcr : DomainClassReference = rc.oclAsType(DomainClassReference)] 
[printTodo(difference.kind.toString(), 'DomainClassReference', dcr.name.toString())/] 
     [else] 
ELSE 
     [/let] 
    [/let] 
[/for] 
[/file] 
[/template] 

[template public printTodo(kind : String, type : String, name : String)] 
//TODO: [kind.toLowerCase().toUpperFirst()/] the [type/] '[name/]' 
[/template] 

Это выход:

/*SQL UPDATE SCRIPT TEST*/ 
//TODO: Add the DomainClass 'null' 

с этой StackTrace в консоли:

!ENTRY org.eclipse.acceleo.engine 2 2 2015-07-22 10:17:00.066 
!MESSAGE Undefined "Let" expression at line 10 in Module generate for block let dc : DomainClass = rc.value.oclAsType(featuremodel::DomainClass). Last recorded value of self was ReferenceChangeSpec{reference=AbstractWithAttributes.attributes, [email protected] Test, parentMatch=MatchSpec{[email protected] Text, [email protected] Text, origin=<null>, #differences=3, #submatches=3}, match of value=MatchSpec{[email protected] Test, right=<null>, origin=<null>, #differences=0, #submatches=0}, kind=ADD, source=LEFT, state=UNRESOLVED}. Problem found while generating the file 'C:\Users\Samuel\Desktop\Workspace\VersionSandbox\models\update.sql'. 
!STACK 0 
org.eclipse.acceleo.engine.AcceleoEvaluationException: Undefined "Let" expression at line 10 in Module generate for block let dc : DomainClass = rc.value.oclAsType(featuremodel::DomainClass). Last recorded value of self was ReferenceChangeSpec{reference=AbstractWithAttributes.attributes, [email protected] Test, parentMatch=MatchSpec{[email protected] Text, [email protected] Text, origin=<null>, #differences=3, #submatches=3}, match of value=MatchSpec{[email protected] Test, right=<null>, origin=<null>, #differences=0, #submatches=0}, kind=ADD, source=LEFT, state=UNRESOLVED}. Problem found while generating the file 'C:\Users\Samuel\Desktop\Workspace\VersionSandbox\models\update.sql'. 
    at generate.generateElement(Comparison)(generate.mtl:10) 
    at generate.generateElement(Comparison)(generate.mtl:9) 
    at generate.generateElement(Comparison)(generate.mtl:8) 
    at generate.generateElement(Comparison)(generate.mtl:6) 
    at generate.generateElement(Comparison)(generate.mtl:4) 

!ENTRY org.eclipse.acceleo.engine 2 2 2015-07-22 10:17:00.073 
!MESSAGE Undefined "Let" expression at line 10 in Module generate for block let dc : DomainClass = rc.value.oclAsType(featuremodel::DomainClass). Last recorded value of self was ReferenceChangeSpec{reference=AbstractWithAttributes.attributes, [email protected] Title, parentMatch=MatchSpec{[email protected] Text, [email protected] Text, origin=<null>, #differences=3, #submatches=3}, match of value=MatchSpec{left=<null>, [email protected] Title, origin=<null>, #differences=0, #submatches=0}, kind=DELETE, source=LEFT, state=UNRESOLVED}. Problem found while generating the file 'C:\Users\Samuel\Desktop\Workspace\VersionSandbox\models\update.sql'. 
!STACK 0 
org.eclipse.acceleo.engine.AcceleoEvaluationException: Undefined "Let" expression at line 10 in Module generate for block let dc : DomainClass = rc.value.oclAsType(featuremodel::DomainClass). Last recorded value of self was ReferenceChangeSpec{reference=AbstractWithAttributes.attributes, [email protected] Title, parentMatch=MatchSpec{[email protected] Text, [email protected] Text, origin=<null>, #differences=3, #submatches=3}, match of value=MatchSpec{left=<null>, [email protected] Title, origin=<null>, #differences=0, #submatches=0}, kind=DELETE, source=LEFT, state=UNRESOLVED}. Problem found while generating the file 'C:\Users\Samuel\Desktop\Workspace\VersionSandbox\models\update.sql'. 
    at generate.generateElement(Comparison)(generate.mtl:10) 
    at generate.generateElement(Comparison)(generate.mtl:9) 
    at generate.generateElement(Comparison)(generate.mtl:8) 
    at generate.generateElement(Comparison)(generate.mtl:6) 
    at generate.generateElement(Comparison)(generate.mtl:4) 

!ENTRY org.eclipse.acceleo.engine 2 2 2015-07-22 10:17:00.077 
!MESSAGE Undefined "Let" expression at line 10 in Module generate for block let dc : DomainClass = rc.value.oclAsType(featuremodel::DomainClass). Last recorded value of self was ReferenceChangeSpec{reference=DomainClass.display, [email protected] Title, parentMatch=MatchSpec{[email protected] Text, [email protected] Text, origin=<null>, #differences=3, #submatches=3}, match of value=MatchSpec{left=<null>, [email protected] Title, origin=<null>, #differences=0, #submatches=0}, kind=CHANGE, source=LEFT, state=UNRESOLVED}. Problem found while generating the file 'C:\Users\Samuel\Desktop\Workspace\VersionSandbox\models\update.sql'. 
!STACK 0 
org.eclipse.acceleo.engine.AcceleoEvaluationException: Undefined "Let" expression at line 10 in Module generate for block let dc : DomainClass = rc.value.oclAsType(featuremodel::DomainClass). Last recorded value of self was ReferenceChangeSpec{reference=DomainClass.display, [email protected] Title, parentMatch=MatchSpec{[email protected] Text, [email protected] Text, origin=<null>, #differences=3, #submatches=3}, match of value=MatchSpec{left=<null>, [email protected] Title, origin=<null>, #differences=0, #submatches=0}, kind=CHANGE, source=LEFT, state=UNRESOLVED}. Problem found while generating the file 'C:\Users\Samuel\Desktop\Workspace\VersionSandbox\models\update.sql'. 
    at generate.generateElement(Comparison)(generate.mtl:10) 
    at generate.generateElement(Comparison)(generate.mtl:9) 
    at generate.generateElement(Comparison)(generate.mtl:8) 
    at generate.generateElement(Comparison)(generate.mtl:6) 
    at generate.generateElement(Comparison)(generate.mtl:4) 

я напечатал rc.value с [код] [rc.value.toString() /] [/ код] в строке 10 для целей отладки, выход был:

/*SQL UPDATE SCRIPT TEST*/ 
[email protected] (versionID: -1) (docoDescription: :), name: Test, listOrderable: false, indexed: NONE, label: true, allowCreate: true, allowUpdate: YES, isDashboard: false, defaultValue: null, tooltip: null, importType: OVERWRITE, required: false) (display: SPINNER) (DBType: INT) 
[email protected] (versionID: 5) (docoDescription: The heading or title for the content text, name: Title, listOrderable: false, indexed: NONE, label: true, allowCreate: true, allowUpdate: YES, isDashboard: false, defaultValue: null, tooltip: The heading or title for the content text, importType: OVERWRITE, required: true) (DBType: VARCHAR, display: TEXTFIELD, i18n: true) 
[email protected] (versionID: 5) (docoDescription: The heading or title for the content text, name: Title, listOrderable: false, indexed: NONE, label: true, allowCreate: true, allowUpdate: YES, isDashboard: false, defaultValue: null, tooltip: The heading or title for the content text, importType: OVERWRITE, required: true) (DBType: VARCHAR, display: TEXTFIELD, i18n: true) 
[email protected] (versionID: -1) (docoDescription: Demo, docoVideoURL: null, name: null) (isDashboard: false) (isMember: false, isOrderable: false, contributeToQuestionTile: NO, allowPermissions: false, hasContent: NO, hasCost: false, hasQuestions: NONE, hasReminder: false, hasTimeline: false, hasWorkflow: false, sharableOn: null, allowCreate: true, allowUpdate: YES, allowDelete: true, allowInactive: false, allowImport: NONE, allowDuplicate: false, allowExport: NONE, contributeToMenu: true) 
//TODO: Add the DomainClass 'null' 

у меня нет подскажите, что делать? Любая помощь была бы очень благодарна

ответ

0

Функция Acceleo Let пытается выполнить бросок и перемещается к следующему блоку, если текущий ток не работает. Поэтому удалите все вызовы .oclAsType (), и он должен работать нормально.

Смежные вопросы