org.jboss.seam.pageflow
Class Pageflow

java.lang.Object
  extended by org.jboss.seam.core.AbstractMutable
      extended by org.jboss.seam.pageflow.Pageflow
All Implemented Interfaces:
Serializable, Mutable

@Scope(value=CONVERSATION)
@PerNestedConversation
@Name(value="org.jboss.seam.pageflow.pageflow")
@BypassInterceptors
@Install(dependencies="org.jboss.seam.bpm.jbpm",
         precedence=0,
         classDependencies="javax.faces.context.FacesContext")
public class Pageflow
extends AbstractMutable
implements Serializable

A Seam component that manages the current jBPM ProcessInstance used for pageflow.

Author:
Gavin King
See Also:
Serialized Form

Constructor Summary
Pageflow()
           
 
Method Summary
 void begin(String pageflowDefinitionName)
          Begin executing a pageflow.
 String getNoConversationViewId(String pageflowName, String pageflowNodeName)
           
 org.jbpm.graph.def.Node getNode()
          Get the current Node of the pageflow.
 Page getPage()
          Get the current Page of the pageflow.
 int getPageflowCounter()
          Get the current counter value, used for detecting illegal use of the backbutton.
protected  org.jbpm.graph.def.ProcessDefinition getPageflowProcessDefinition(String pageflowName)
           
 String getPageViewId()
          Get the JSF view id of the current page in the pageflow.
 org.jbpm.graph.exe.ProcessInstance getProcessInstance()
           
 org.jbpm.graph.exe.ProcessInstance getSubProcessInstance()
           
protected  String getViewId(Page page)
          Allows the user to extend this class and use some logical naming of pages other than the JSF view id in their pageflow.
 boolean hasDefaultTransition()
          Does the current node have a default transition?
 boolean hasTransition(String outcome)
           
protected  void illegalNavigation()
          Add a message to indicate that illegal navigation occurred.
static Pageflow instance()
           
 boolean isInProcess()
           
 boolean isStarted()
           
protected  void navigate(javax.faces.context.FacesContext context)
          Navigate to the current page.
 void navigate(javax.faces.context.FacesContext context, String outcome)
          Given the JSF action outcome, perform navigation according to the current pageflow.
 void processEvents(String type)
          Process events defined in the pageflow.
protected  void raiseBeginEvent(String pageflowDefinitionName)
           
protected  void raiseEndEventIfNecessary()
           
protected  void redirect(Page page)
          Redirect to the Page.
protected  void render(javax.faces.context.FacesContext context, Page page)
          Proceed to render the Page.
 void reposition(String nodeName)
          Reposition the pageflow at the named node.
 void setProcessInstance(org.jbpm.graph.exe.ProcessInstance processInstance)
           
 String toString()
           
 void validatePageflow(javax.faces.context.FacesContext facesContext)
          Check that the current state of the pageflow matches what is expected by the faces request.
 
Methods inherited from class org.jboss.seam.core.AbstractMutable
clearDirty, setDirty, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pageflow

public Pageflow()
Method Detail

isInProcess

public boolean isInProcess()

isStarted

public boolean isStarted()

getProcessInstance

public org.jbpm.graph.exe.ProcessInstance getProcessInstance()

setProcessInstance

public void setProcessInstance(org.jbpm.graph.exe.ProcessInstance processInstance)

instance

public static Pageflow instance()

getPageflowCounter

public int getPageflowCounter()
Get the current counter value, used for detecting illegal use of the backbutton.


validatePageflow

public void validatePageflow(javax.faces.context.FacesContext facesContext)
Check that the current state of the pageflow matches what is expected by the faces request.


illegalNavigation

protected void illegalNavigation()
Add a message to indicate that illegal navigation occurred. May be overridden by user to perform special processing.


getNode

public org.jbpm.graph.def.Node getNode()
Get the current Node of the pageflow.


getSubProcessInstance

public org.jbpm.graph.exe.ProcessInstance getSubProcessInstance()

reposition

public void reposition(String nodeName)
Reposition the pageflow at the named node.

Parameters:
nodeName - the name of a node

getPage

public Page getPage()
Get the current Page of the pageflow.


navigate

protected void navigate(javax.faces.context.FacesContext context)
Navigate to the current page.


redirect

protected void redirect(Page page)
Redirect to the Page.


render

protected void render(javax.faces.context.FacesContext context,
                      Page page)
Proceed to render the Page.


getViewId

protected String getViewId(Page page)
Allows the user to extend this class and use some logical naming of pages other than the JSF view id in their pageflow.

Parameters:
page - the Page object
Returns:
a JSF view id

getPageViewId

public String getPageViewId()
Get the JSF view id of the current page in the pageflow.


hasDefaultTransition

public boolean hasDefaultTransition()
Does the current node have a default transition?


hasTransition

public boolean hasTransition(String outcome)

navigate

public void navigate(javax.faces.context.FacesContext context,
                     String outcome)
Given the JSF action outcome, perform navigation according to the current pageflow.


raiseEndEventIfNecessary

protected void raiseEndEventIfNecessary()

processEvents

public void processEvents(String type)
Process events defined in the pageflow.

Parameters:
type - one of: "process-validations", "update-model-values", "invoke-application", "render-response"

begin

public void begin(String pageflowDefinitionName)
Begin executing a pageflow.

Parameters:
pageflowDefinitionName - the name of the pageflow definition

raiseBeginEvent

protected void raiseBeginEvent(String pageflowDefinitionName)

getNoConversationViewId

public String getNoConversationViewId(String pageflowName,
                                      String pageflowNodeName)

getPageflowProcessDefinition

protected org.jbpm.graph.def.ProcessDefinition getPageflowProcessDefinition(String pageflowName)

toString

public String toString()
Overrides:
toString in class Object