I'm pretty sure it is a bug. I've been struggling with this some months ago and eventually just used the same solution you did. I've not had the time (nor the knowledge of Seam internal) to track this down. Since I was not sure it was my fault, I did not file a bug in Jira. Lately (you are the second in a week) I became convinced it is a bug.
File an issue in JIRA and clearly state the issue (I don't understand Asaf's post)
I will, have to make a full test case first though, so it can be attached to the jira issue. Due to moving to my new house and the upcomming jBPM community day this will not happen in two weeks. Maybe Asaf can help out.
Has onyone filed JIRA for this? I have this use case:
SFSB (among others) outjecting variables into BP context when creating the process. Any time I call another method on the bean the variables are null (not injecting them back) and therefore removed from the JBPM table of variables. Is this expected scenario?
If yes, do I have to also inject the variables? Or create a standalone bean responsible only for creating the process (and outject them only here)?
No, I haven't, sorry. The code I had the problem with got lost and I do not know in detail how to recreate. If you have some example that demonstrates the problem, I'm happy to turn that into a unittest
The problem you is not the expected scenario. Has something to do with the scope. In jBPM you can set variables on processlevel (businessscope) and tasklevel (combination of a specific conversation and businessscope) So maybe it was oversimplified in seam.
Thanks Roland. i know about the level, went thorugh Seam source as well. I had a SFSB with method startProcess() and doTask(). Process was created, variables outjected, everything ok. As soon as doTask() was called on the bean, it outjected the variables with null values, which basically dereferenced them from the instance/token.
I ended up extracting the startProcess() method into a stateless Seam component including only this one method and it works ok now.