commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@apache.org
Subject cvs commit: jakarta-commons-sandbox/workflow/src/java/org/apache/commons/workflow/core package.html
Date Mon, 19 Nov 2001 04:56:49 GMT
craigmcc    01/11/18 20:56:49

  Modified:    workflow/src/java/org/apache/commons/workflow/core
                        package.html
  Log:
  Document a few more Step executions.
  
  Revision  Changes    Path
  1.3       +138 -3    jakarta-commons-sandbox/workflow/src/java/org/apache/commons/workflow/core/package.html
  
  Index: package.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/workflow/src/java/org/apache/commons/workflow/core/package.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- package.html	2001/11/18 23:38:51	1.2
  +++ package.html	2001/11/19 04:56:49	1.3
  @@ -90,8 +90,28 @@
     <core:goto step="notOk">
   </pre>
   
  +<a name="core:call"></a>
   <h3>core:call</h3>
   
  +<p>The <em>core:call</em> Step pops the top value from the evaluation
stack,
  +which must be an <a href="../Activity.html">Activity</a>, and initiates a
  +"subroutine call" to execute this Activity before resuming the current one.
  +Control will be returned to the step following this one, once the called
  +Activity executes an <a href="#core:exit">core:exit</a> Step, or the last
  +defined Step in the Activity has been executed.</p>
  +
  +<p>In the example below, the <code>activity</code> property of the
  +<code>process</code> bean is assumed to return an instance of Activity that
  +is to be executed to accomplish a portion of a business process.  This allows
  +components to manage the overall control flow dynamically.</p>
  +<pre>
  +  &lt;core:get&gt;
  +    &lt;core:descriptor xpath="process/activity"/&gt;
  +  &lt;/core:get&gt;
  +  &lt;core:call&gt;
  +</pre>
  +
  +
   <h3>construct</h3>
   
   <h3>duplicate</h3>
  @@ -105,12 +125,90 @@
   <h3>invoke</h3>
   
   <h3>load</h3>
  +
  +<a name="notAnd"></a>
  +<h3>core:notAnd</h3>
  +
  +<p>The <em>core:notAnd</em> Step evaluates the properties specified by
all
  +nested <code>&lt;core:descriptor&gt;</code> elements, and transfers
control
  +to the specified step if ALL of them are <code>false</code> (if boolean) or
  +null (if Object).  To avoid non-deterministic evaluation stack behavior, all of
  +the nested <code>&lt;core:descriptor&gt; elements are always evaluated.</p>
  +
  +<p><em>NOTE:</em> - This is the exact opposite of
  +<a href="#and">and</a>.</p>
  +
  +<p>The <em>core:notAnd</em> element recognizes the following attributes:
  +<ul>
  +<li><strong>id</strong> - Optional identifier of this Step, which can
be used
  +    as the destination for control transfers.  If specified, must be unique
  +    within the current Activity.</li>
  +<li><strong>step</strong> - Identifier of the Step (within this Activity)
to
  +    which control should be transferred if the condition is met.</li>
  +</ul>
  +
  +<p>You may nest any number of <a href="#core:descriptor">core:descriptor</a>
  +elements within a <em>core:notAnd</em> element.  All of them will be evaluated
  +in order to determine whether or not a branch to the Step specified by the
  +<em>step</em> attribute should occur or not.</p>
  +
  +<p>In the following example, control will branch to the Step labelled
  +<code>empty</code> if all of the specified properties of the
  +<code>address</code> bean return null String values.  Otherwise, control will
  +be transferred (via the <em>core:goto</em> Step) to the Step labelled
  +<code>notEmpty</code>.</p>
  +<pre>
  +  &lt;core:notAnd step="empty"&gt;
  +    &lt;core:descriptor xpath="address/street1"/&gt;
  +    &lt;core:descriptor xpath="address/city"/&gt;
  +    &lt;core:descriptor xpath="address/state"/&gt;
  +    &lt;core:descriptor xpath="address/zipCode"/&gt;
  +  &lt;/core:and&gt;
  +  &lt;core:goto step="notEmpty"&gt;
  +</pre>
  +
  +<a name="core:notOr"></a>
  +<h3>core:notOr</h3>
   
  -<h3>notAnd</h3>
  +<p>The <em>core:notOr</em> Step evaluates the properties specified by
all
  +nested <code>&lt;core:descriptor&gt;</code> elements, and transfers
control
  +to the specified step if ANY of them are <code>false</code> (if boolean) or
  +null (if Object).  To avoid non-deterministic evaluation stack behavior, all of
  +the nested <code>&lt;core:descriptor&gt; elements are always evaluated.</p>
   
  -<h3>notOr</h3>
  +<p><em>NOTE:</em> - This is the exact opposite of
  +<a href="#or">or</a>.</p>
   
  +<p>The <em>core:notOr</em> element recognizes the following attributes:
  +<ul>
  +<li><strong>id</strong> - Optional identifier of this Step, which can
be used
  +    as the destination for control transfers.  If specified, must be unique
  +    within the current Activity.</li>
  +<li><strong>step</strong> - Identifier of the Step (within this Activity)
to
  +    which control should be transferred if the condition is met.</li>
  +</ul>
   
  +<p>You may nest any number of <a href="#core:descriptor">core:descriptor</a>
  +elements within a <em>core:or</em> element.  All of them will be evaluated
  +in order to determine whether or not a branch to the Step specified by the
  +<em>step</em> attribute should occur or not.</p>
  +
  +<p>In the following example, control will branch to the Step labelled
  +<code>notOk</code> if any of the specified properties of the
  +<code>address</code> bean return null String values.  Otherwise,
  +control will be transferred (via the <em>core:goto</em> Step)
  +to the Step labelled <code>ok</code>.</p>
  +<pre>
  +  &lt;core:and step="notOk"&gt;
  +    &lt;core:descriptor xpath="address/street1"/&gt;
  +    &lt;core:descriptor xpath="address/city"/&gt;
  +    &lt;core:descriptor xpath="address/state"/&gt;
  +    &lt;core:descriptor xpath="address/zipCode"/&gt;
  +  &lt;/core:and&gt;
  +  &lt;core:goto step="ok"&gt;
  +</pre>
  +
  +
   <a name="core:or"></a>
   <h3>core:or</h3>
   
  @@ -157,8 +255,45 @@
   <h3>remove</h3>
   
   <h3>string</h3>
  +
  +<a name="core:suspend"></a>
  +<h3>core:suspend</h3>
   
  -<h3>suspend</h3>
  +<p>The <em>core:suspend</em> Step signals our
  +<a href="../Context.html">Context</a> to suspend the execution of the Activity
  +being processed.  The most recent <code>Context.execute()</code> call will
  +return immediately.  On the next call to <code>Context.execute()</code>,
  +processing will continue with the Step after this one.</p>
  +
  +<p>This Step is designed for scenarios where you wish to allow the application
  +that is managing your workflows to interact with the user before proceeding.
  +It is especially useful in a web environment, where Activity execution
  +<strong>must</strong> be suspended in order to complete the current
  +<code>HttpServletResponse</code>, and await the next
  +<code>HttpServletRequest</code>.</p>
  +
  +<p><em>Note</em> - It does not matter how deeply nested you might be
in
  +<a href="#core:call">core:call</a> calls to subordinate Activity executions.
  +The state of the entire computation is immediately suspended, and will resume
  +on the next call to <code>Context.execute()</code>, without the calling
  +application needing to be aware of the nesting.</p>
  +
  +<p>In the following example, it is assumed that you are using the Workflow
  +system in an MVC-style framework, which uses
  +<code>RequestDispatcher.forward()</code> to pass control to the resource
  +responsible for creating a particular response.  Control will be suspended
  +until the next request comes in, at which point execution will be resumed.
  +Thus, a simple multi-page interaction could be scripted like this (in a real
  +scenario, you would want to deal with "next page" and "previous page"
  +navigation links as well).</p>
  +<pre>
  +  &lt;web:forward page="/page-1.jsp"/&gt;
  +  &lt;core:suspend/&gt;
  +  ... process first input request ...
  +  &lt;web:forward page="/page=2.jsp"/&gt;
  +  &lt;core:suspend/&gt;
  +  ... process second input request ...
  +</pre>
   
   <h3>swap</h3>
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message