[jboss-cvs] JBossAS SVN: r105552 - projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 2 01:33:25 EDT 2010


Author: misty at redhat.com
Date: 2010-06-02 01:33:24 -0400 (Wed, 02 Jun 2010)
New Revision: 105552

Modified:
   projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Jbpm.xml
Log:
JBPAPP-4387

Modified: projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Jbpm.xml
===================================================================
--- projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Jbpm.xml	2010-06-02 05:23:44 UTC (rev 105551)
+++ projects/docs/enterprise/EAP/trunk/5.x/Seam_Reference_Guide/en-US/Jbpm.xml	2010-06-02 05:33:24 UTC (rev 105552)
@@ -55,7 +55,7 @@
 				Here is an example pageflow definition using JSF navigation rules:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<navigation-rule>
+<programlisting language="XML" role="XML"><![CDATA[<navigation-rule>
   <from-view-id>/numberGuess.jsp</from-view-id>
         
   <navigation-case>
@@ -82,7 +82,7 @@
 				Here is the same example pageflow definition using Seam navigation rules:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page view-id="/numberGuess.jsp">    
+<programlisting language="XML" role="XML"><![CDATA[<page view-id="/numberGuess.jsp">    
   <navigation>
   
     <rule if-outcome="guess">
@@ -104,19 +104,19 @@
 				If you find navigation rules too verbose, you can return view IDs directly from your action listener methods:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[public String guess() { 
+<programlisting language="Java" role="JAVA">public String guess() { 
   if (guess==randomNumber) return "/win.jsp"; 
   if (++guessCount==maxGuesses) return "/lose.jsp"; 
   return null; 
-}]]>
+}
 </programlisting>
 			 <para>
 				Note that this results in a redirect. You can also specify parameters to be used in the redirect:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[public String search() { 
+<programlisting language="Java" role="JAVA">public String search() { 
   return "/searchResults.jsp?searchPattern=#{searchAction.searchPattern}"; 
-}]]>
+}
 </programlisting>
 			 <para>
 				The stateful model defines a set of transitions between a set of named, logical application states. With this model, you can express the flow of any user interaction entirely in the jPDL pageflow definition, and write action listener methods that are completely unaware of the flow of the interaction.
@@ -125,7 +125,7 @@
 				Here is an example page flow definition using jPDL:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<pageflow-definition name="numberGuess">
+<programlisting language="XML" role="XML"><![CDATA[<pageflow-definition name="numberGuess">
   <start-page name="displayGuess" view-id="/numberGuess.jsp">
     <redirect/>
     <transition name="guess" to="evaluateGuess">
@@ -199,13 +199,13 @@
 				In this case, the <literal>no-conversation-view-id</literal> declaration goes in <filename>pages.xml</filename>. This tells Seam to redirect to a different page if a request originates from a page that was rendered during a conversation that no longer exists:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page view-id="/checkout.xhtml" no-conversation-view-id="/main.xhtml"/>]]>
+<programlisting language="XML" role="XML"><![CDATA[<page view-id="/checkout.xhtml" no-conversation-view-id="/main.xhtml"/>]]>
 </programlisting>
 			 <para>
 				On the other hand, in the stateful model, the back button is interpreted as an undefined transition back to a previous state. Since the stateful model enforces a defined set of transitions from the current state, the back button is, by default, not permitted in the stateful model. Seam transparently detects the use of the back button, and blocks any attempt to perform an action from a previous, "stale" page, redirecting the user to the "current" page (and displaying a Faces message). Although developers view this as a feature, it can be frustrating from the user&#39;s perspective. You can enable back button navigation from a particular page node by setting <literal>back="enabled"</literal>.
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page name="checkout" view-id="/checkout.xhtml" back="enabled">
+<programlisting language="XML" role="XML"><![CDATA[<page name="checkout" view-id="/checkout.xhtml" back="enabled">
   <redirect/>
   <transition to="checkout"/>
   <transition name="complete" to="complete"/>
@@ -223,7 +223,7 @@
 				We must still define what happens if a request originates from a page rendered during a pageflow, and the conversation with the pageflow no longer exists. In this case, the <literal>no-conversation-view-id</literal> declaration goes into the pageflow definition:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page name="checkout" view-id="/checkout.xhtml" back="enabled" 
+<programlisting language="XML" role="XML"><![CDATA[<page name="checkout" view-id="/checkout.xhtml" back="enabled" 
       no-conversation-view-id="/main.xhtml">
   <redirect/>
   <transition to="checkout"/>
@@ -245,13 +245,13 @@
 				We need to install the Seam jBPM-related components, and place the pageflow definitions (using the standard <filename>.jpdl.xml</filename> extension) inside a Seam archive (an archive containing a <filename>seam.properties</filename> file):
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<bpm:jbpm />]]>
+<programlisting language="XML" role="XML"><![CDATA[<bpm:jbpm />]]>
 </programlisting>
 			 <para>
 				We can also explicitly tell Seam where to find our pageflow definition. We specify this in <filename>components.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<bpm:jbpm> 
+<programlisting language="XML" role="XML"><![CDATA[<bpm:jbpm> 
   <bpm:pageflow-definitions> 
     <value>pageflow.jpdl.xml</value> 
   </bpm:pageflow-definitions> 
@@ -265,13 +265,13 @@
 				We "start" a jPDL-based pageflow by specifying the name of the process definition with a <literal>@Begin</literal>, <literal>@BeginTask</literal> or <literal>@StartTask</literal> annotation:
 			</para>
 			 
-<programlisting role="JAVA">@Begin(pageflow="numberguess") public void begin() { ... }
+<programlisting language="Java" role="JAVA">@Begin(pageflow="numberguess") public void begin() { ... }
 </programlisting>
 			 <para>
 				Alternatively, we can start a pageflow using <filename>pages.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page> 
+<programlisting language="XML" role="XML"><![CDATA[<page> 
   <begin-conversation pageflow="numberguess"/> 
 </page>]]>
 </programlisting>
@@ -282,7 +282,7 @@
 				But if the pageflow is begun as the result of an action listener invocation, the outcome of the action listener determines the first page to be rendered. In this case, we use a <literal><![CDATA[<start-state>]]></literal> as the first node in the pageflow, and declare a transition for each possible outcome:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<pageflow-definition name="viewEditDocument">
+<programlisting language="XML" role="XML"><![CDATA[<pageflow-definition name="viewEditDocument">
   <start-state name="start">
     <transition name="documentFound" to="displayDocument"/>
     <transition name="documentNotFound" to="notFound"/>
@@ -309,7 +309,7 @@
 				Each <literal><![CDATA[<page>]]></literal> node represents a state where the system is waiting for user input:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page name="displayGuess" view-id="/numberGuess.jsp"> 
+<programlisting language="XML" role="XML"><![CDATA[<page name="displayGuess" view-id="/numberGuess.jsp"> 
   <redirect/> 
   <transition name="guess" to="evaluateGuess"> 
     <action expression="#{numberGuess.guess}" /> 
@@ -323,7 +323,7 @@
 				The transition name is the name of a JSF outcome triggered by clicking a command button or command link in <filename>numberGuess.jsp</filename>.
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:commandButton type="submit" value="Guess" action="guess"/>
+<programlisting language="XML" role="XML"><![CDATA[<h:commandButton type="submit" value="Guess" action="guess"/>
 ]]>
 </programlisting>
 			 <para>
@@ -333,13 +333,13 @@
 				In the case of a null outcome (for example, a command button with no <literal>action</literal> defined), Seam signals the transition with no name (if one exists), or simply redisplay the page if all transitions are named. Therefore we could simplify this button and our pageflow like so:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:commandButton type="submit" value="Guess"/>]]>
+<programlisting language="XML" role="XML"><![CDATA[<h:commandButton type="submit" value="Guess"/>]]>
 </programlisting>
 			 <para>
 				This would fire the following un-named transition:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page name="displayGuess" view-id="/numberGuess.jsp">
+<programlisting language="XML" role="XML"><![CDATA[<page name="displayGuess" view-id="/numberGuess.jsp">
   <redirect/>
   <transition to="evaluateGuess">
     <action expression="#{numberGuess.guess}" />
@@ -350,11 +350,11 @@
 				The button could also call an action method, in which case the action outcome determines the transition to be made:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:commandButton type="submit" value="Guess" 
+<programlisting language="XML" role="XML"><![CDATA[<h:commandButton type="submit" value="Guess" 
    action="#{numberGuess.guess}"/>]]>
 </programlisting>
 			 
-<programlisting role="XML"><![CDATA[<page name="displayGuess" view-id="/numberGuess.jsp">
+<programlisting language="XML" role="XML"><![CDATA[<page name="displayGuess" view-id="/numberGuess.jsp">
   <transition name="correctGuess" to="win"/>
   <transition name="incorrectGuess" to="evaluateGuess"/>
 </page>]]>
@@ -370,7 +370,7 @@
 				Usually, the more powerful features of jPDL are not required when defining pageflows. However, we do require the <literal><![CDATA[<decision>]]></literal> node:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
+<programlisting language="XML" role="XML"><![CDATA[<decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
   <transition name="true" to="win"/>
   <transition name="false" to="evaluateRemainingGuesses"/>
 </decision>]]>
@@ -386,7 +386,7 @@
 				We end the conversation with <literal><![CDATA[<end-conversation>]]></literal> or <literal>@End</literal>. For the sake of readability, we encourage you to use both.
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page name="win" view-id="/win.jsp">
+<programlisting language="XML" role="XML"><![CDATA[<page name="win" view-id="/win.jsp">
   <redirect/>
   <end-conversation/>
 </page>]]>
@@ -395,7 +395,7 @@
 				Optionally, we can end a task, or specify a jBPM <literal>transition</literal> name. In this case, Seam signals the end of the current task in the overarching business process.
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page name="win" view-id="/win.jsp">
+<programlisting language="XML" role="XML"><![CDATA[<page name="win" view-id="/win.jsp">
   <redirect/>
   <end-task transition="success"/>
 </page>]]>
@@ -408,7 +408,7 @@
 				It is possible to compose pageflows so that one pageflow pauses while another pageflow executes. The <literal><![CDATA[<process-state>]]></literal> node pauses the outer pageflow, and begins execution of a named pageflow:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<process-state name="cheat">
+<programlisting language="XML" role="XML"><![CDATA[<process-state name="cheat">
   <sub-process name="cheat"/>
   <transition to="displayGuess"/>
 </process-state>]]>
@@ -429,7 +429,7 @@
 			A simple business process definition resembles a pageflow definition, except that instead of <literal><![CDATA[<page>]]></literal> nodes, we use <literal><![CDATA[<task-node>]]></literal> 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.
 		</para>
 		 
-<programlisting role="XML"><![CDATA[<process-definition name="todo">
+<programlisting language="XML" role="XML"><![CDATA[<process-definition name="todo">
   <start-state name="start">
     <transition to="todo"/>
   </start-state>
@@ -466,7 +466,7 @@
 				First, we must install jBPM and tell it where to find the business process definitions:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<bpm:jbpm> 
+<programlisting language="XML" role="XML"><![CDATA[<bpm:jbpm> 
   <bpm:process-definitions> 
     <value>todo.jpdl.xml</value> 
   </bpm:process-definitions> 
@@ -483,14 +483,14 @@
 				We always need to know which user is currently logged in. jBPM recognizes users with their <emphasis>actor ID</emphasis> and <emphasis>group actor ID</emphasis>. We specify the current actor IDs with the built-in Seam component, <literal>actor</literal>:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[@In Actor actor;
+<programlisting language="Java" role="JAVA">@In Actor actor;
 
 public String login() {
   ...
   actor.setId( user.getUserName() );
   actor.getGroupActorIds().addAll( user.getGroupNames() );
   ...
-}]]>
+}
 </programlisting>
 		</section>
 		
@@ -500,14 +500,14 @@
 				To initiate a business process instance, we use the <literal>@CreateProcess</literal> annotation:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[@CreateProcess(definition="todo") 
-public void createTodo() { ... }]]>
+<programlisting language="Java" role="JAVA">@CreateProcess(definition="todo") 
+public void createTodo() { ... }
 </programlisting>
 			 <para>
 				Alternatively we can initiate a business process using <filename>pages.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page>
+<programlisting language="XML" role="XML"><![CDATA[<page>
   <create-process definition="todo" />
 </page>]]>
 </programlisting>
@@ -519,7 +519,7 @@
 				When a process reaches a task node, task instances are created. These must be assigned to users or user groups. We can either hardcode our actor IDs, or delegate to a Seam component:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<task name="todo" description="#{todoList.description}">
+<programlisting language="XML" role="XML"><![CDATA[<task name="todo" description="#{todoList.description}">
   <assignment actor-id="#{actor.id}"/>
 </task>]]>
 </programlisting>
@@ -527,7 +527,7 @@
 				In this case, we have simply assigned the task to the current user. We can also assign tasks to a pool:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<task name="todo" description="#{todoList.description}">
+<programlisting language="XML" role="XML"><![CDATA[<task name="todo" description="#{todoList.description}">
   <assignment pooled-actors="employees"/>
 </task>]]>
 </programlisting>
@@ -539,7 +539,7 @@
 				Several built-in Seam components make it easy to display task lists. The <literal>pooledTaskInstanceList</literal> is a list of pooled tasks that users may assign to themselves:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:dataTable value="#{pooledTaskInstanceList}" var="task">
+<programlisting language="XML" role="XML"><![CDATA[<h:dataTable value="#{pooledTaskInstanceList}" var="task">
   <h:column>
     <f:facet name="header">Description</f:facet>
     <h:outputText value="#{task.description}"/>
@@ -554,7 +554,7 @@
 				Note that instead of <literal><![CDATA[<s:link>]]></literal>, we can use a plain JSF <literal><![CDATA[<h:commandLink>]]></literal>:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:commandLink action="#{pooledTask.assignToCurrentActor}">
+<programlisting language="XML" role="XML"><![CDATA[<h:commandLink action="#{pooledTask.assignToCurrentActor}">
   <f:param name="taskId" value="#{task.id}"/>
 </h:commandLink>]]>
 </programlisting>
@@ -565,7 +565,7 @@
 				The <literal>taskInstanceListForType</literal> component includes tasks of a particular type that are assigned to the current user:
 			</para>
 			 
-<programlisting role="XHTML"><![CDATA[<h:dataTable value="#{taskInstanceListForType['todo']}" var="task">
+<programlisting language="XML" role="XML"><![CDATA[<h:dataTable value="#{taskInstanceListForType['todo']}" var="task">
   <h:column>
     <f:facet name="header">Description</f:facet>
     <h:outputText value="#{task.description}"/>
@@ -584,13 +584,13 @@
 				To begin work on a task, we use either <literal>@StartTask</literal> or <literal>@BeginTask</literal> on the listener method:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[@StartTask public String start() { ... }]]>
+<programlisting language="Java" role="JAVA">@StartTask public String start() { ... }
 </programlisting>
 			 <para>
 				Alternatively, we can begin work on a task with <filename>pages.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page>
+<programlisting language="XML" role="XML"><![CDATA[<page>
   <start-task />
 </page>]]>
 </programlisting>
@@ -601,14 +601,14 @@
 				If we end the conversation with <literal>@EndTask</literal>, Seam signals the completion of the task:
 			</para>
 			 
-<programlisting role="JAVA"><![CDATA[@EndTask(transition="completed") 
-public String completed() { ... }]]>
+<programlisting language="Java" role="JAVA">@EndTask(transition="completed") 
+public String completed() { ... }
 </programlisting>
 			 <para>
 				Alternatively, we can use <filename>pages.xml</filename>:
 			</para>
 			 
-<programlisting role="XML"><![CDATA[<page>
+<programlisting language="XML" role="XML"><![CDATA[<page>
   <end-task transition="completed" />
 </page>]]>
 </programlisting>




More information about the jboss-cvs-commits mailing list