Discussion:
[Erp5-dev] redirection from workflow scripts
Bartek Gorny
2006-09-26 18:29:48 UTC
Permalink
Hello

Is it possible to send a redirect from interaction workflow script?
The point is that in certain conditions I need to create a new object,
instead of editing the current one, and the best thing would be to
immediately redirect the user to the new one. But it seems that
workflows do not care about return value, so the usual
return context.REQUEST.RESPONSE.redirect(target_url)
has no effect. Is there a way to do it from workflow script, or do I
need to overwrite _edit method?

Bartek
--
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"
Jérôme Perrin
2006-10-02 11:27:18 UTC
Permalink
Post by Bartek Gorny
Hello
Is it possible to send a redirect from interaction workflow script?
I don't think so.
You can try:
raise 'Redirect', url
but the transaction will be aborted, which is probably not what you want.
Post by Bartek Gorny
The point is that in certain conditions I need to create a new object,
instead of editing the current one, and the best thing would be to
immediately redirect the user to the new one.
Probably it's better to make an explicit action on your portal type that will
create the new object.
--
J?rome
Jean-Paul Smets
2006-10-02 12:07:44 UTC
Permalink
Post by Jérôme Perrin
Post by Bartek Gorny
Hello
Is it possible to send a redirect from interaction workflow script?
I don't think so.
raise 'Redirect', url
but the transaction will be aborted, which is probably not what you want.
I would disagree with the idea of sending a redirect from interaction
workflow. It is not their purpose at all.
Post by Jérôme Perrin
Post by Bartek Gorny
The point is that in certain conditions I need to create a new object,
instead of editing the current one, and the best thing would be to
immediately redirect the user to the new one.
Probably it's better to make an explicit action on your portal type that
will create the new object.
Yes.
--
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org
Rentalinux: Desktop Linux Server
http://www.rentalinux.com
Loading...