Help

Inactive Bloggers
10. Feb 2006, 04:08 CET, by Gavin King

Seam 1.0 beta 2 has been released:

http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=163777

There are too many changes and new features for me to list them all here, but I'll talk briefly about the three most interesting things.

The first is the idea of workspace management. You can see this feature in action by trying out the Seam Issue Tracker demo application that is included in the Seam distribution. Workspace management is like a Windows taskbar for web applications: the user can view a list of active workspaces (Seam conversations), switch between them and manage them, all within a single browser window. The list of workspaces may be represented as a drop down menu or clickable list. If you use Seam's powerful new nested conversation model, you can even have Seam automatically manage a meaningful trail of breadcrumbs.

You don't have to write any Java code to take advantage of workspace management in Seam, just include some standard JSF fragments in your JSP or Facelets pages.

For more information about this stuff, refer to the Seam documentation:

http://docs.jboss.com/seam/reference/en/html/conversations.html#d0e2374

The second new feature is tight integration with jBPM. In Seam, jBPM can fill two distinctly different roles.

The first role is traditional business process management (workflow). In this case, jBPM and Seam provide management of task lists, task assignment, business process execution, and business process state without any need to write any Java code. You can call Seam components from your jPDL file in exactly the same way that you call Seam components from a JSF page: by writing a JSF EL expression.

For example, the following trivial Seam/jPDL workflow definition might be used to describe a TODO list.

<process-definition name="todo">
  
  <start-state name="start">
     <transition to="todo"/>
  </start-state>
  
  <task-node name="todo">
     <task name="todo" description="#{todoList.description}">
        <assignment actor-id="#{actor.id}"/>
     </task>
     <transition to="done">
        <action expression="#{todoList.sendEmail}"/>
     </transition>
  </task-node>
  
  <end-state name="done"/>
  
</process-definition>

Check out the Seam DVD Store or Todo List examples to see exactly how this stuff fits together, or refer to the Seam documentation:

http://docs.jboss.com/seam/reference/en/html/jbpm.html#d0e2696 The second application of jBPM in Seam is pageflow definition. A Seam jPDL pageflow defines the navigation for a particular conversation. Just like a business process definition, we use JSF EL to define the interaction between the pageflow and the Seam components. This lets us centralize all information about the flow of the user interaction, and how the different components and pages fit together to implement the user interaction in one place.

Here is an example pageflow for a number guessing game:

<pageflow-definition name="numberGuess">
  
  <start-state name="start">
     <transition to="displayGuess"/>
  </start-state>
  
  <page name="displayGuess" view-id="/numberGuess.jsp" redirect="true">
     <transition name="guess" to="evaluateGuess">
     	<action expression="#{numberGuess.guess}" />
     </transition>
  </page>
  
  <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
     <transition name="true" to="win"/>
     <transition name="false" to="evaluateRemainingGuesses"/>
  </decision>
  
  <decision name="evaluateRemainingGuesses" expression="#{numberGuess.lastGuess}">
     <transition name="true" to="lose"/>
     <transition name="false" to="displayGuess"/>
  </decision>
  
  <page name="win" view-id="/win.jsp" redirect="true">
     <end-conversation />
  </page>
  
  <page name="lose" view-id="/lose.jsp" redirect="true">
     <end-conversation />
  </page>
  
</pageflow-definition>

Notice how easy it is to get an understanding how the pages and Seam components fit together to solve the business problem.

For more information, refer to the Seam DVD Store or Number Guess examples in the Seam distribution, or to the Seam documentation:

http://docs.jboss.com/seam/reference/en/html/jbpm.html#d0e2530

The final interesting new feature is the application reverse engineering functionality provided by the latest release of Hibernate Tools. It takes just minutes to create a pretty full-featured application with CRUD, Search screens and full association navigation. This is a great way to get started with Seam.

More information (including screenshots) here:

http://docs.jboss.com/seam/reference/en/html/tools.html

Over the past few months, Seam has developed a vibrant community and so I've enjoyed working on this project more than anything since the early days of Hibernate. Thanks to everyone who has been involved!