Hi,

1) RI documentation says that conversation bean can be acccessed from EL
with name "
conversation": 
http://docs.jboss.org/weld/reference/1.0.1-CR2/en-US/html/scopescontexts.html#d0e1882
 (but is it mentioned in spec?)

This is probably not implemented in OWB. Simple hack in WebBeansELresolver 
solves it:

if ("conversation".equals(property)) {
                context.setPropertyResolved(true);
                return 
manager.getInstanceByType(javax.enterprise.context.Conversation.class);
}

but this is only first try.

2) accessing conversation scope as java.util.Map from EL

JSF currently has implicit objects sessionScope, requestScope, viewScope  ... 
It would be nice if OWB can expose current conversation context as map too - 
see example below.


3) JSF 2.0 support custom scopes: 
http://blogs.sun.com/rlubke/entry/custom_managed_bean_scopes. 
Maybe exposing conversation context as custom scope can be useful for existing 
applications.


4) uses cases for conversation: I checked all our applications and the most 
common use case is (unsurprisingly):
- start conversation
- put some objects into conversation scope
- start dialog/conversation with user
- user ends dialog
- end conversation

following example comes from trinidad:

<h:commandButton action="dialog:textEdit" 
returnListener="#{bean.processReturn}">
        <f:setPropertyActionListener value="a value passed to dialog" 
target="#{pageFlowScope.valueKey}" />
        <f:setPropertyActionListener value="other value passed to dialog" 
target="#{pageFlowScope.otherValueKey}" />
</h:commandButton>


with CDI (and 1 and 2 implemented) it looks:

<h:commandButton action="dialog:textEdit" 
returnListener="#{conversation.end()}">
        <f:actionListener binding="conversation.start()" />
        <f:setPropertyActionListener value="a value passed to dialog" 
target="#{conversationScope.valueKey}" />
        <f:setPropertyActionListener value="other value passed to dialog" 
target="#{conversationScope.otherValueKey}" />
</h:commandButton>

What do you think? I'm not sure what belongs to CDI implementation and what 
should be a separate extension. 


Regards,

Martin Kočí






Reply via email to