Hi, we are using a Portlet Seam RichFaces configuration in our projects since one year ago and it works very well, but now we need to add BPM functions to our stack and we are having problems. We don't know if Seam-jBPM can be used in a Seam-Portlet configuration, we didn't found nothing about that. Our first doubt will be, is that possible? can we use workflows in a Seam-Portlet (using the Seam annotations and facilities of course)?
Well, let's suppose that's possible and we are doing something wrong.
The test we are trying to do is very simple. We get the Ticketing example of the book:
JBoss Seam, Simplicity and Power beyond Java EE (by Michael Juntao Yuan and Thomas Heute, Prentice Hall), and we added all the required artifacts to run the example as a Portlet.
- The ready to be deployed EAR file can be downloaded here: rudder-app.ear
- Also the source code can be downloaded from: sourceTicketing.zip
This example is a little application with the following logic (three steps):
- login.xhtml: this is the Home Page of the portlet and shows the login form. The form is connected with the LoginAction EJB that is responsible to initialize the Actor (needed by the jBPM runtime). After login, the system redirect us to
- home.xhtml: this page shows all the actions we can do, the first one allow us create a new
Ticket. Let's do click over the
Create a new ticketoption and we will be redirect to the
- newTickect.xhtml: here we found the problem. In that page we can fill the Ticket data (a Seam POJO component), and then invoke the
newTicket()action in the TicketSystemAction EJB. This method is annotated with a @CreateProcess and is the resonsible of initiate automatically a new instance of the process
THE PROBLEM: Everything runs well util the end of the resquest. The new process instance is created and persisted into the database, but an exception is thrown at the end of the request, when Seam is flushing and disposing the Contexts. The BusinessProcess Context is trying to load the current ProcessInstance but the Session is closed (the transaction is commited before clean the contexts).
We are forgotten something in the configuration?
Thanks in advance!.
Our stack is:
- JBoss AS 4.2.2.GA
- JBoss Portal 2.6.4.GA
The EAR has the nexts library versions:
- JBoss Seam 2.1.0.A1
- JBoss Portlet Bridge 1.0.0.B1
- JBoss jBPM 3.2.3
- JBoss EL 2.0.1.GA
- Javassist 3.3.ga
- Richfaces 3.1.4.SR1 (but is not used by the example)
- Facelets 1.1.14