Conversation em Grails
27/12/2011 04:45
0
Olá,

estudando o Jboss Seam vi que lá tem a sacada do "escopo de conversação" (conversation scope) que ajuda a prevenir muitos problemas com uso do escopo de sessão.

Vi algumas coisas parecidas na documentação do Grails mas ainda tá bem diferente do JBoss. Alguém já fez ou sabe como fazer algo parecido com "scopo de conversação" em Grails?

Abraços.
Tags: seam conversação conversation


0
Camarada,

Fizemos alguns casos de uso usando o plugin WebFlow (que utiliza o WebFlow do Spring).

Seu funcionamento é bem interessante e recomendo sua utilização.

No livro Grails In Action (disponível para download em: http://www.wowebook.me/book/grails-in-action/) há uma boa introdução.

Uma característica desse plugin é algo bem groovy: os caras criaram uma DSL para tratar a máquina de estado do fluxo da "conversação". A notação ficou muito boa e intuitiva.


0
Legal... MAS olha, acho que essa versão 2.0 sei não se já era pra ser lançada como GA hehehe a cada dia vejo um novo problema nela.

Simplesmente não consigo instalar o webflow plugin.
Comando: install-plugin webflow (tentei pra versão 1.3.7 e 1.3.6)

Erro:
:: problems summary ::
:::: WARNINGS
module not found: org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE
==== grailsPlugins: tried
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
/home/yoshiriro/workspaces/ipiranga/eleicoes2012/lib/org.springframework.webflow-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/tomcat-2.0.0/lib/org.springframework.webflow-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/resources-1.1.5/lib/org.springframework.webflow-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/webxml-1.4.1/lib/org.springframework.webflow-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/webflow-1.3.7/lib/org.springframework.webflow-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/hibernate-2.0.0/lib/org.springframework.webflow-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/jquery-1.7.1/lib/org.springframework.webflow-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.webflow/ivy-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.webflow/jars/org.springframework.webflow-2.0.8.RELEASE.jar
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.webflow/bundles/org.springframework.webflow-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/src/libs/org.springframework.webflow-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/src/libs/org.springframework.webflow-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/dist/org.springframework.webflow-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/dist/org.springframework.webflow-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/.grails/2.0.0/cached-installed-plugins/org.springframework.webflow-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
/home/yoshiriro/.grails/2.0.0/cached-installed-plugins/org.springframework.webflow-2.0.8.RELEASE.jar
==== grailsHome: tried
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/plugins/org.springframework.webflow-2.0.8.RELEASE.jar
==== grailsCentral: tried
http://plugins.grails.org/grails-org.springframework.webflow/tags/RELEASE_2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
http://plugins.grails.org/grails-org.springframework.webflow/tags/RELEASE_2.0.8.RELEASE/grails-org.springframework.webflow-2.0.8.RELEASE.jar
==== http://repo.grails.org/grails/plugins: tried
http://repo.grails.org/grails/plugins/org/springframework/webflow/org.springframework.webflow/2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
http://repo.grails.org/grails/plugins/org/springframework/webflow/org.springframework.webflow/2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.jar
==== http://repo.grails.org/grails/core: tried
http://repo.grails.org/grails/core/org/springframework/webflow/org.springframework.webflow/2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
http://repo.grails.org/grails/core/org/springframework/webflow/org.springframework.webflow/2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.jar
==== grailsCore: tried
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-org.springframework.webflow/tags/RELEASE_2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-org.springframework.webflow/tags/RELEASE_2.0.8.RELEASE/grails-org.springframework.webflow-2.0.8.RELEASE.jar
==== mavenCentral: tried
http://repo1.maven.org/maven2/org/springframework/webflow/org.springframework.webflow/2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE!org.springframework.webflow.jar:
http://repo1.maven.org/maven2/org/springframework/webflow/org.springframework.webflow/2.0.8.RELEASE/org.springframework.webflow-2.0.8.RELEASE.jar
module not found: org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE
==== grailsPlugins: tried
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
/home/yoshiriro/workspaces/ipiranga/eleicoes2012/lib/org.springframework.binding-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/tomcat-2.0.0/lib/org.springframework.binding-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/resources-1.1.5/lib/org.springframework.binding-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/webxml-1.4.1/lib/org.springframework.binding-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/webflow-1.3.7/lib/org.springframework.binding-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/hibernate-2.0.0/lib/org.springframework.binding-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/jquery-1.7.1/lib/org.springframework.binding-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.binding/ivy-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.binding/jars/org.springframework.binding-2.0.8.RELEASE.jar
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.binding/bundles/org.springframework.binding-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/src/libs/org.springframework.binding-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/src/libs/org.springframework.binding-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/dist/org.springframework.binding-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/dist/org.springframework.binding-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/.grails/2.0.0/cached-installed-plugins/org.springframework.binding-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
/home/yoshiriro/.grails/2.0.0/cached-installed-plugins/org.springframework.binding-2.0.8.RELEASE.jar
==== grailsHome: tried
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/plugins/org.springframework.binding-2.0.8.RELEASE.jar
==== grailsCentral: tried
http://plugins.grails.org/grails-org.springframework.binding/tags/RELEASE_2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
http://plugins.grails.org/grails-org.springframework.binding/tags/RELEASE_2.0.8.RELEASE/grails-org.springframework.binding-2.0.8.RELEASE.jar
==== http://repo.grails.org/grails/plugins: tried
http://repo.grails.org/grails/plugins/org/springframework/webflow/org.springframework.binding/2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
http://repo.grails.org/grails/plugins/org/springframework/webflow/org.springframework.binding/2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.jar
==== http://repo.grails.org/grails/core: tried
http://repo.grails.org/grails/core/org/springframework/webflow/org.springframework.binding/2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
http://repo.grails.org/grails/core/org/springframework/webflow/org.springframework.binding/2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.jar
==== grailsCore: tried
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-org.springframework.binding/tags/RELEASE_2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-org.springframework.binding/tags/RELEASE_2.0.8.RELEASE/grails-org.springframework.binding-2.0.8.RELEASE.jar
==== mavenCentral: tried
http://repo1.maven.org/maven2/org/springframework/webflow/org.springframework.binding/2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE!org.springframework.binding.jar:
http://repo1.maven.org/maven2/org/springframework/webflow/org.springframework.binding/2.0.8.RELEASE/org.springframework.binding-2.0.8.RELEASE.jar
module not found: org.springframework.webflow#org.springframework.js;2.0.8.RELEASE
==== grailsPlugins: tried
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
/home/yoshiriro/workspaces/ipiranga/eleicoes2012/lib/org.springframework.js-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/tomcat-2.0.0/lib/org.springframework.js-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/resources-1.1.5/lib/org.springframework.js-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/webxml-1.4.1/lib/org.springframework.js-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/webflow-1.3.7/lib/org.springframework.js-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/hibernate-2.0.0/lib/org.springframework.js-2.0.8.RELEASE.jar
/home/yoshiriro/.grails/2.0.0/projects/eleicoes2012/plugins/jquery-1.7.1/lib/org.springframework.js-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.js/ivy-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.js/jars/org.springframework.js-2.0.8.RELEASE.jar
/home/yoshiriro/Programas/grails/grails-2.0.0/lib/org.springframework.webflow/org.springframework.js/bundles/org.springframework.js-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/src/libs/org.springframework.js-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/src/libs/org.springframework.js-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/Programas/grails/grails-2.0.0/dist/org.springframework.js-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/dist/org.springframework.js-2.0.8.RELEASE.jar
==== grailsHome: tried
/home/yoshiriro/.grails/2.0.0/cached-installed-plugins/org.springframework.js-2.0.8.RELEASE.xml
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
/home/yoshiriro/.grails/2.0.0/cached-installed-plugins/org.springframework.js-2.0.8.RELEASE.jar
==== grailsHome: tried
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
/home/yoshiriro/Programas/grails/grails-2.0.0/plugins/org.springframework.js-2.0.8.RELEASE.jar
==== grailsCentral: tried
http://plugins.grails.org/grails-org.springframework.js/tags/RELEASE_2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
http://plugins.grails.org/grails-org.springframework.js/tags/RELEASE_2.0.8.RELEASE/grails-org.springframework.js-2.0.8.RELEASE.jar
==== http://repo.grails.org/grails/plugins: tried
http://repo.grails.org/grails/plugins/org/springframework/webflow/org.springframework.js/2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
http://repo.grails.org/grails/plugins/org/springframework/webflow/org.springframework.js/2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.jar
==== http://repo.grails.org/grails/core: tried
http://repo.grails.org/grails/core/org/springframework/webflow/org.springframework.js/2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
http://repo.grails.org/grails/core/org/springframework/webflow/org.springframework.js/2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.jar
==== grailsCore: tried
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-org.springframework.js/tags/RELEASE_2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
http://svn.codehaus.org/grails/trunk/grails-plugins/grails-org.springframework.js/tags/RELEASE_2.0.8.RELEASE/grails-org.springframework.js-2.0.8.RELEASE.jar
==== mavenCentral: tried
http://repo1.maven.org/maven2/org/springframework/webflow/org.springframework.js/2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.pom
-- artifact org.springframework.webflow#org.springframework.js;2.0.8.RELEASE!org.springframework.js.jar:
http://repo1.maven.org/maven2/org/springframework/webflow/org.springframework.js/2.0.8.RELEASE/org.springframework.js-2.0.8.RELEASE.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.springframework.webflow#org.springframework.webflow;2.0.8.RELEASE: not found
:: org.springframework.webflow#org.springframework.binding;2.0.8.RELEASE: not found
:: org.springframework.webflow#org.springframework.js;2.0.8.RELEASE: not found
::::::::::::::::::::::::::::::::::::::::::::::



Pesquisei na net mas ninguém parece ter resolvido esse problema ¬¬'

Acredito que em breve sai uma versão "2.0.1" com uma baita lista de "bug fixes" pra 2.0.0 rsrsrs. Acredito que tenham se precipitado. Deveriam haver mais 1 ou 2 "RCs" pra sair um "GA" estável mesmo.


0
Na verdade, era um problema do STS (StringSource Tool Suite) 2.8.1 que ainda não oferece suporte 100% ao Grails 2.0.
Ao tentar fazer a mesma operação somente via linha de comando funcionou certinho.

Via STS só mandando executar "install-plugin webflow 2.0.0" porque senão a IDE tentava instalar a versão 1.3.7 do plugin e por isso dava o bug.

De qualquer forma, abri um ISSUE para isso em http://jira.grails.org/browse/GRAILS-8547 antes de descobrir como resolver e depois expliquei tudo.



Ainda não faz parte da comunidade???

Para se registrar, clique aqui.


Aprenda Groovy e Grails com a Formação itexto!

Newsletter Semana Groovy

Assinar

Envie seu link!


Livro de Grails


/dev/All

Os melhores blogs de TI (e em português) em um único lugar!

 
Creative Commons
RSS Grails Brasil é mantido por itexto Consultoria.
Em caso de problemas contacte Henrique Lobo Weissmann (Kico) por e-mail: kico@itexto.com.br
Todo o conteúdo presente neste site adota o Creative Commons como licença padrão.
Ver: 4.14.0
itexto