Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

22.4. Annotations for context demarcation

These annotations provide declarative conversation demarcation. They appear on methods of Seam components, usually action listener methods.
Every web request has a conversation context associated with it. Most of these conversations end at the end of the request. If you want a conversation that span multiple requests, you must "promote" the current conversation to a long-running conversation by calling a method marked with @Begin.
@Begin
  • @Begin
    
    Specifies that a long-running conversation begins when this method returns a non-null outcome without exception.
  • @Begin(ifOutcome={"success", "continue"})
    
    Specifies that a long-running conversation begins when this action listener method returns with one of the given outcomes.
  • @Begin(join=true)
    
    Specifies that if a long-running conversation is already in progress, the conversation context is simply propagated.
  • @Begin(nested=true)
    
    Specifies that if a long-running conversation is already in progress, a new nested conversation context begins. The nested conversation will end when the next @End is encountered, and the outer conversation will resume. It is perfectly legal for multiple nested conversations to exist concurrently in the same outer conversation.
  • @Begin(pageflow="process definition name")
    
    Specifies a jBPM process definition name that defines the pageflow for this conversation.
  • @Begin(flushMode=FlushModeType.MANUAL)
    
    Specify the flush mode of any Seam-managed persistence contexts. flushMode=FlushModeType.MANUAL supports the use of atomic conversations where all write operations are queued in the conversation context until an explicit call to flush() (which usually occurs at the end of the conversation).
    • ifOutcome — specifies the JSF outcome or outcomes that result in a new long-running conversation context.
    • join — determines the behavior when a long-running conversation is already in progress. If true, the context is propagated. If false, an exception is thrown. Default to false. This setting is ignored when nested=true is specified
    • nested — specifies that a nested conversation should be started if a long-running conversation is already in progress.
    • flushMode — set the flush mode of any Seam-managed Hibernate sessions or JPA persistence contexts that are created during this conversation.
    • pageflow — a process definition name of a jBPM process definition deployed via org.jboss.seam.core.jbpm.pageflowDefinitions.
@End
  • @End
    
    Specifies that a long-running conversation ends when this method returns a non-null outcome without exception.
  • @End(ifOutcome={"success", "error"}, evenIfException={SomeException.class, OtherException.class})
    
    Specifies that a long-running conversation ends when this action listener method returns with one of the given outcomes or throws one of the specified classes of exception.
    • ifOutcome — specifies the JSF outcome or outcomes that result in the end of the current long-running conversation.
    • beforeRedirect — by default, the conversation will not actually be destroyed until after any redirect has occurred. Setting beforeRedirect=true specifies that the conversation should be destroyed at the end of the current request, and that the redirect will be processed in a new temporary conversation context.
@StartTask
@StartTask
"Starts" a jBPM task. Specifies that a long-running conversation begins when this method returns a non-null outcome without exception. This conversation is associated with the jBPM task specified in the named request parameter. Within the context of this conversation, a business process context is also defined, for the business process instance of the task instance.
The jBPM TaskInstance will be available in a request context variable named taskInstance. The jPBM ProcessInstance will be available in a request context variable named processInstance. (Of course, these objects are available for injection via @In.)
  • taskIdParameter — the name of a request parameter which holds the id of the task. Default to "taskId", which is also the default used by the Seam taskList JSF component.
  • flushMode — set the flush mode of any Seam-managed Hibernate sessions or JPA persistence contexts that are created during this conversation.
@BeginTask
@BeginTask
Resumes work on an incomplete jBPM task. Specifies that a long-running conversation begins when this method returns a non-null outcome without exception. This conversation is associated with the jBPM task specified in the named request parameter. Within the context of this conversation, a business process context is also defined, for the business process instance of the task instance.
The jBPM TaskInstance will be available in a request context variable named taskInstance. The jPBM ProcessInstance will be available in a request context variable named processInstance.
  • taskIdParameter — the name of a request parameter which holds the id of the task. Default to "taskId", which is also the default used by the Seam taskList JSF component.
  • flushMode — set the flush mode of any Seam-managed Hibernate sessions or JPA persistence contexts that are created during this conversation.
@EndTask
  • @EndTask
    
    "Ends" a jBPM task. Specifies that a long-running conversation ends when this method returns a non-null outcome, and that the current task is complete. Triggers a jBPM transition. The actual transition triggered will be the default transition unless the application has called Transition.setName() on the built-in component named transition.
  • @EndTask(transition="transitionName")
    
    Triggers the given jBPM transition.
  • @EndTask(ifOutcome={"success", "continue"})
    
    Specifies that the task ends when this method returns one of the listed outcomes.
    • transition — the name of the jBPM transition to be triggered when ending the task. Defaults to the default transition.
    • ifOutcome — specifies the JSF outcome or outcomes that result in the end of the task.
    • beforeRedirect — by default, the conversation will not actually be destroyed until after any redirect has occurred. Setting beforeRedirect=true specifies that the conversation should be destroyed at the end of the current request, and that the redirect will be processed in a new temporary conversation context.
@CreateProcess
@CreateProcess(definition="process definition name")
Creates a new jBPM process instance when the method returns a non-null outcome without exception. The ProcessInstance object will be available in a context variable named processInstance.
  • definition — the name of the jBPM process definition deployed via org.jboss.seam.core.jbpm.processDefinitions.
@ResumeProcess
@ResumeProcess(processIdParameter="processId")
Re-enters the scope of an existing jBPM process instance when the method returns a non-null outcome without exception. The ProcessInstance object will be available in a context variable named processInstance.
  • processIdParameter — the name a request parameter holding the process id. Default to "processId".

 
 
  Published under the terms of the Open Publication License Design by Interspire