1 of 1 people found this helpful
Well if the edit link does not contain the cid parameter, you should be able to start a new long-running conversation. But if the link contains the cid parameter, the whole request will be tied to the conversation with the requested cid, and you will not be able to start a new conversatoin in that request. A request is always associated with exactly one conversation.
In other words, all you need to do is to make sure the edit link does not have the cid parameter.
thank you very much for your helpful reply. The remaining question is on how to render a h:commandLink from an already existing long-running transaction WITHOUT the cid (as far as I understood the cid gets inserted automatically as soon as the response is rendered within an already existing long running conversation). Can I somehow influence this behaviour, eg. in the h:form tag? I know it is VERY counter-intuitive to what JSR-299/Weld is supposed to be doing for me, because it keeps all related stuff synched with the same conversation id... only that I wand JSF to render a response with a JSF link that is NOT part of the current long-running conversation.
In terms of the example above: There are two areas in the browser window, a "left tree" with the search result and edit person links and a "work area" with one "tab" for each person "in editing". When I click the "edit" link in the left tree, the whole browser-window re-rendereds (w/o AJAX) and thus the cid of the most recently opened partner editor becomes part of each "edit" link. So whenever I click another "edit" link (for another partner), it already has a conversation id assigned to it - the one of the first edited partner. This not only breaks my intention, it also results in an exception similar to "cannot promote a conversation that already is long-running".
Do you really need a commandLink? If you create your edit link with <h:link>, the cid will not be in the href of the link. The cid is automatically propagated only with <h:commandLink> and such.
Take a look at http://www.andygibson.net/blog/tutorial/cdi-conversations-part-2/ (the bottom section: Workspace management). I think this is exactly what you are looking for. In your case, each tab is a separate workspace, so each tab will have a <h:link ...><f:param name="cid"...></h:link> in the tab itself. For links in the left tree, simply use <h:link> without <f:param>.
Thanks Marko, this was exactly what I was looking for.