Wednesday, December 10, 2008

Extended Persistence Context

An Extended Persistence Context is useful in managing conversational web applications by providing the ability to the programmer to keep the persistent objects "live" till the conversation with the user is over. The persistent actions performed during the interaction can be flushed to the database or kept queued in the persistence context using transaction attribute settings.

A very good blog by Sahoo is available that lists the rules of propagation of an extended persistence context to called J2EE components. 


Tuesday, August 12, 2008

JBoss Seam Page Flow Configuration Tips

Here are some tips for avoiding problems in defining Page Flows with JBoss Seam.
  • You need the jbpm-jpdl.jar file in your ear file. It comes with the Seam download. Otherwise you will get deploy errors complaining about the class org/jbpm/graph/exe/ProcessInstance not found.
  • First define page flows in files suffixed .jpdl.xml.
  • File names need not match the flow names defined inside them.
  • Put the page flow definitions in the components.xml file which must go in the META-INF dir. The relevant segment will look like this:


<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpm="http://jboss.com/products/seam/bpm">

<bpm:jbpm>
<bpm:pageflow-definitions>
<value>myPageFlow.jpdl.xml</value>
</bpm:pageflow-definitions>
</bpm:jbpm>
</components>

  • When you have hierarchically dependent page flows then the file in which the more basic flow (subflow or sub-process) must be listed earlier in the the components.xml's jbpm file list.
  • So for example:
  •    

    <bpm:jbpm>
    <bpm:pageflow-definitions>
    <value>subFlow.jpdl.xml</value>
    <value>dependentFlow.jpdl.xml</value>
    </bpm:pageflow-definitions>
    </bpm:jbpm>