Timeline for How would you create a custom CDI @ProcessScope?
Current License: CC BY-SA 3.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 22, 2017 at 23:13 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Jan 23, 2017 at 21:44 | history | bumped | CommunityBot | This question has answers that may be good or bad; the system has marked it active so that they can be reviewed. | |
Dec 24, 2016 at 19:53 | answer | added | maress | timeline score: 1 | |
Dec 21, 2016 at 16:42 | comment | added | keuleJ | Why don't you use @SessionScoped for this? | |
Dec 21, 2016 at 2:10 | history | tweeted | twitter.com/StackSoftEng/status/811393426663108609 | ||
Dec 20, 2016 at 9:14 | comment | added | Thomas | Hmm, conversations themselves might not be the perfect match for your processes but they are similar which is why I suggested having a look at them. Of course you'd have to communicate the process id to all contributors but that should be doable as long as there is a means to identify those contributors (e.g. by them being called). Maybe you could provide a small example (ideally with a small diagram) that shows how your processes would work in general. | |
Dec 19, 2016 at 17:34 | comment | added | mikee | I am not sure how the conversation id would be communicated between all the contributors to the process, or how CDI would understand how to interpret it? I am starting to think my assumption that CDI was the answer to this problem is flawed, and perhaps I would be better of looking at an events and observers pattern instead to allow the contributors to communicate status between each other? | |
Dec 19, 2016 at 17:06 | comment | added | Thomas |
I don't see that question being closed so I'm not sure what you mean here. Besides that processes and conversations are very similar. It's true that ConversationScoped originates from JSF but it isn't limited to it (we've been using conversations and similar scopes with struts2 etc.). But think about it: what is a process? It's some finite unit of work that is started by someone or something and which one or more processes/services/systems are involved in. Now replace one of those "systems" by the user and you basically get a conversation. Thus the concepts are very similar.
|
|
Dec 19, 2016 at 16:54 | comment | added | mikee | Hi Thomas ConversationScoped apears to be JSF centric, there is no conversation with the end user during a REST interaction. I did just come across a similar question on StackOverflow (stackoverflow.com/questions/38395462/…) which I am looking at now. Given that this question is so similar I would to understand why it was closed as "off topic" by @Bohemian | |
Dec 19, 2016 at 16:24 | comment | added | Thomas |
Please correct me if I missed something but isn't your ProcessScope very similar to a ConversationScope which already exists? If so you could either use that or at least get some ideas of how it is implemented. When implementing it yourself you'd need a ProcessContext anyways so if you are able to detect when a process is being started and when it is finished you'd store the related beans in that context.
|
|
Dec 19, 2016 at 16:14 | history | migrated | from stackoverflow.com (revisions) | ||
Dec 19, 2016 at 16:12 | history | asked | mikee | CC BY-SA 3.0 |