gpt4 book ai didi

grails - grails webflow错误

转载 作者:行者123 更新时间:2023-12-02 14:55:17 24 4
gpt4 key购买 nike

我有这个grails webflow

def currencyDescriptionFlow = {
start {
action {
flow.messageCommand = new MessageCommand()
flow.currencyId = params.id
flow.languageList = Language.findAll([sort: 'codeDescription', order: 'asc'])
}
on('success').to('description')
}

description{
action{
flow.DescriptionMessageList = Message.findAllByKey(flow.currencyId + '_Currency')
}
on('add').to('addSubmit')
on('finish').to('currencyShow')
}

addSubmit{
action {
MessageCommand cmd ->
flow.messageCommand = cmd
if (!flow.messageCommand.validate()){
error()
}
}
on('error').to('description')
on('success').to('description')
}

saveMessage{
action{
def str = flow.currencyId + '_Currency'
messageSevice.descriptionMultiLanguage(str, params.description, params.Language)
}
on('error').to('description')
on('success').to('description')
}

currencyShow{
redirect(controller:'currency', action: "show", id: flow.currencyId)
}
}

当我单击链接重定向到此页面时,发生错误
Error 500: No transition was matched on the event(s) signaled by the [1] action(s) 
that executed in this action state 'description' of flow 'message/currencyDescription';
transitions must be defined to handle action result outcomes -- possible flow
configuration error? Note: the eventIds signaled were: 'array<String>
['success']', while the supported set of transitional criteria for this action
state is 'array<TransitionCriteria>[add, finish]'

Servlet: grails

URI: /adm-appserver-manager/grails/message/currencyDescription.dispatch

Exception Message: No transition was matched on the event(s) signaled by the [1]
action(s) that executed in this action state 'description' of flow 'message/currencyDescription';
transitions must be defined to handle action result outcomes -- possible flow
configuration error? Note: the eventIds signaled were: 'array<String>
['success']', while the supported set of transitional criteria for this action state
is 'array<TransitionCriteria>[add, finish]'

Caused by: No transition was matched on the event(s) signaled by the [1] action(s)
that executed in this action state 'description' of flow 'message/currencyDescription';
transitions must be defined to handle action result outcomes -- possible flow
configuration error? Note: the eventIds signaled were: 'array<String>['success']',
while the supported set of transitional criteria for this action state is
'array<TransitionCriteria>[add, finish]'

Class: Unknown

At Line: [-1]

Code Snippet:

注意:
where language is a table in the database
MessageCommand is command object
messageService is a service
descriptionMultiLanguage method in message service for saving message


i try this way of writing code in another action and controoler and it works without any error.


by debugging this code i found the error on (
on('add').to('addSubmit')
on('finish').to('currencyShow')
)
when i remove these 2 lines , no problem found

最佳答案

def currencyDescriptionFlow = {
start {
action {
flow.messageCommand = new MessageCommand()
flow.currencyId = params.id
flow.languageList = Language.findAll([sort: 'codeDescription', order: 'asc'])
flow.DescriptionMessageList = Message.findAllByKey(flow.currencyId + '_Currency')
}
on('success').to('description')
}

description{
on('add').to('addSubmit')
on('finish').to('currencyShow')
}

addSubmit{
action {
MessageCommand cmd ->
flow.messageCommand = cmd
if (!flow.messageCommand.validate()){
error()
}
flow.message = null
}
on('error').to('description')
on('success').to('saveMessage')
}

saveMessage{
action{
Message messageInstance = new Message(language:flow.messageCommand.language,value:flow.messageCommand.value,key:flow.currencyId + '_Currency')
if (!messageInstance.save(flush:true)){
flow.message = "${message(code: 'error.adding.description')}"
error()
}
flow.DescriptionMessageList = Message.findAllByKey(flow.currencyId + '_Currency')
}
on('error').to('description')
on('success').to('description')
}

currencyShow{
redirect(controller:'currency', action: "show", id: flow.currencyId)
}
}

关于grails - grails webflow错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7887689/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com