[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
In your code that alters data raise an event: | Events.instance().raiseEvent(YOUR_EVENT_NAME); | In code that can refresh the data model: | @Observer(YOUR_EVENT_NAME) | public void refreshTheDataModel() { | | // your code to refresh the data model goes here | } | View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032044#4032044 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032044 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
I love elegant solutions. Thanks a lot View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032051#4032051 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032051 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
I am getting greedy now. Is there somewhere I can place the event call inside a @Conversational bean so that it will get fired on any @End call? I have many many ways to end a conversation here. I thought like this... | @Remove @Destroy @RaiseEvent(YOUR_EVENT_NAME) | public void destroy() {} | | | | ... although I suspect someone will call me naughty for doing this? This also requires me to ask if @Destroy is called directly after @End. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032074#4032074 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032074 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
The booking example uses a transactionSuccessEvent for this. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032126#4032126 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032126 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
anonymous wrote : In your code that alters data raise an event: It's better to use an afterTransactionSuccess event, more elegant txn model. anonymous wrote : I am getting greedy now. Is there somewhere I can place the event call inside a @Conversational bean so that it will get fired on any @End call? Seam has a built-in event that it fires at the end of every conversation. You can listen for that, and then raise an afterTransactionSuccess event from the listener. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032131#4032131 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032131 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
Thanks for the response Gavin. As the refresh is a potentially expenisve operation I wanted to limit it to just the conversation that bean is involved in. I noticed the org.jboss.seam.endConversation in the docs before but assumed it was any conversation as it lacks the '' part such as for pageflows org.jboss.seam.endPageflow.. Am I misreading (unlikely as whoever write the docs does a great job ;0)) or is there a way to limit the event interception to a single bean, or perhaps examine the event trigger on processing? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032184#4032184 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032184 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
Well, can't you use an action in the jBPM process definition for that? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=403#403 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=403 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Conceptual/Best Practice Question
I also have a stateful page view that displays a list of as a @DataModel. I also have conversations external to the page that manipulate entries int he model. I call back from the conversations... and manipulate the mode. In my code that requires to manipulate the model Inject it. | /** | * Biject the Find Users Controller which has to refine its list of Users | * When we update the Users then we have to laise with the FindUsersController to refine its list of users. | */ | @In(create=true) | private FindUserController findUserController; | then call back to it | @End | @TransactionAttribute(TransactionAttributeType.REQUIRED) | public String create() { | log.info( create); | user.getDates().setCreationDate(new Date()); | user.setPassword(encryptionController.encrypt(user.getPassword())); | em.persist(user); | em.flush(); | facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_INFO, user_create_successful); | | /* | * We need to add this user to the list of users in the session scoped FindUserController | */ | if (findUserController != null) { | findUserController.addUserToExistingList(user); | } | | log.info( create); | return success; | } | | In my model, it doesn't have to re-read anything from the database. I found this useful as I had problems managing to get my stateful model to re-read from the database as it only kept reading from the cache! and I didn't know how to invalidate the cache. It did save any reads from the database. However, I am sure Gavins way is better. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4032237#4032237 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4032237 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user