9.3. Business process management in Seam

A business process is a set of tasks that must be performed by users or software systems according to well-defined rules regarding who can perform a certain task, and when that task should be performed. Seam's jBPM integration makes it easy to let users view and manage their task lists. Seam also lets the application store state associated with the business process in the BUSINESS_PROCESS context, and makes that state persistent through jBPM variables.
A simple business process definition resembles a pageflow definition, except that instead of <page> nodes, we use <task-node> nodes. In a long-running business process, the wait state occurs where the system is waiting for some user to log in and perform a task.
<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"/>
  </task-node>
   
  <end-state name="done"/>
   
</process-definition>
jPDL business process definitions and jPDL pageflow definitions can be used in the same project. When this occurs, a single <task> in a business process corresponds to a whole pageflow <pageflow-definition>.