📄 workflow.html
字号:
<h3>Workflow Management System Implementation Objects</h3>
<div class="indent">
<p>The following classes represent the primary components of the
workflow management system:</p>
<p>
<strong>Registry</strong> - Collection into which multiple
<em>Process</em> and <em>Activity</em> static descriptions can be
stored and retrieved by String-valued keys.</p>
<p>
<strong>Process</strong> - The static description of a tree of
business activities that are executed in a nested fashion, often by
separate individuals (or application systems).</p>
<p>
<strong>Activity</strong> - The static description of a sequence
of Steps that are generally executed by a single individual (or
application system), within a reasonably short period of time.</p>
<p>
<strong>Step</strong> - The static description of an individual
task to be performed as a discrete, indivisible, unit. Steps can
also be nested inside other steps, to provide for looping and
conditional processing. A rich set of built-in Step implementations
shall be provided (including powerful capabilities such as the
execution of an arbitrary method on an arbitrary Java object), and
mechanisms to extend the set of supported Step implementations
allows arbitrary extensibility.</p>
<p>
<strong>Context</strong> - The dynamic state of a computation
through an <em>Activity</em> (or a set of nested <em>Activities</em>),
including provision of storage space for JavaBeans produced and
consumed by other Steps. Contexts keep track of the current Step
being executed, so that activity processing can be suspended and
resumed later.</p>
<p>
<strong>Scope</strong> - A <code>Map</code> into which
arbitrary Java objects can stored and retrieved by String-valued keys.
Context support a number of individual Scopes, each of which can be
plugged in from application logic, to provide integration into
existing application functionality. For example, in a web application
implementation, Scopes will generally be mapped directly to request
attributes, session attributes, and servlet context attributes as
provided by the Servlet API.</p>
</div>
<h3>Built-In Steps</h3>
<div class="indent">
<p>A rich variety of built-in <em>Step</em> implementations (and
corresponding XML elements in specified namespaces) will be provided
as part of the basic workflow engine, and as part of the associated
Struts integration of this engine.</p>
<p>
<strong>Bean Interaction</strong> - The ability to get and set
JavaBeans in arbitrary Scopes (mapped via the Context to real collections
of objects).</p>
<p>
<strong>Control Flow</strong> - Conditionals and looping, where
control flow Steps can contain nested sets of Steps to an arbitrary
degree.</p>
<p>
<strong>Method Execution</strong> - Execute arbitrary public methods
of beans stored in some Scope, passing specified arguments (expressions
or bean references) and returning the method's result (if any) to a
named bean in some Scope. To maximize usefulness of the workflow
system in composing applications, <strong>no</strong> restrictions
should be placed on the object types these Steps can interact with.</p>
<p>
<strong>Activity Management</strong> - GOTO a named Activity
(exiting the current one), CALL a named Activity (resuming the current
one when the called Activity returns, RETURN from a called Activity,
EXIT the Activity system.</p>
<p>
<strong>User Interaction</strong> - Suspend workflow execution to
interact with the user in some application specific way. For example,
a web application would display a page and wait for input to be
submitted before resuming the workflow.</p>
<p>
<strong>Specialized Processing</strong> - Prebuilt Steps for common
processing functions such as XSLT transformations, performing
arbitrary SQL queries, sending mail, and so on.</p>
</div>
</div>
<h2>Implementation Notes</h2>
<div class="indent">
<p>The implementation of this proposal will be divided into three major
development layers:</p>
<ul>
<li>Core workflow management system capabilities and built in Step
implementations that are independent of application environment.
[Code in jakarta-commons]</li>
<li>Specialized implementation of workflow management system components
that integrate with the Servlet API in a manner that is independent
of any specific application framework. [Code in jakarta-commons]</li>
<li>Specialized implementation of workflow management system components
that is tightly integrated with Struts's internal architecture and
custom tag libraries. [Code in jakarta-struts]</li>
</ul>
<p>The workflow management system will support the general concept of
<em>Scopes</em> in which beans can be stashed, with pluggable
implementations for integration into different working environments.
None of the APIs in the workflow engine itself will have any reference
to the web layer (i.e. no imports of <code>javax.servlet.*</code>).</p>
<p>Suitable object factory and pluggability APIs will be included
to guarantee extensibility of the basic framework.
</p>
<p>Scripting of business transactions will be codified in XML documents
that conform to an appropriate DTD and/or schema. The XML technology
that is used will facilitate extensible definitions of <em>Steps</em>
and other components, in both the XML description of these components and
in the set of Java objects that implements them.
</p>
<p>When designing the detailed syntax of the XML representation
of Steps, consider whether it is feasible for advanced development
tools to "compile" activities into individual classes to optimize
overall performance.
</p>
<p>When designing the detailed syntax of the XML representation
of Steps, consideration should be given to emulating the syntax
of other XML applications that are similar in spirit or detail
to the concepts of scripting a business transaction. Useful
models to consider include:
</p>
<ul>
<li>
<a href="http://www.w3.org/TR/xslt">XSL Transformations (XSLT)</a>
- Includes control flow mechanisms that are becoming widely
known and understood, which could be mimicked.</li>
<li>
<a href="http://jakarta.apache.org/taglibs/jsptl-doc/intro.html">
JSP Standard Tag Library (Early Access)</a> - The design goals for
many of the JSP custom tags in this library (produced by the
JSR-052 expert group under the Java Community Process) are similar
enough to provide a useful model for conditionals, looping, and
interaction with objects in arbitrary scopes.</li>
</ul>
<p>To maximize the usefulness of built-in actions, an expression
language that knows how to manipulate objects in the Scopes associated
with the current Context will need to be supported. Useful models to
consider include:</p>
<ul>
<li>
<a href="http://www.w3.org/TR/xpath">XML Path Language (XPath)</a>
- Will be familiar to XML-oriented application developers because
it is used throughout the suite of XML specifications.</li>
<li>JavaScript like expression languages - Will be familiar to page
developers (as well as Struts developers familiar with the
nested and indexed property accessor syntax of many Struts tags).</li>
</ul>
<p>From the workflow script developer's point of view, XML namespaces
will be used to introduce extended sets of Step implementations. There
will need to be mechanisms to map a particular namespace to a set of
legal XML elements (within that namespace) and corresponding Java
classes that provide the functionality for those Steps.</p>
<p>The web layer integration will include a mechanism to map scopes (from
the workflow perspective) into the standard <em>request</em>,
<em>session</em>, and <em>application</em> scopes of the web layer.
Thus, workflow scripts will be able to place beans in appropriate
scopes such that JSP pages can directly pull that data into the presentation,
much as Struts Actions (and the business logic classes that are called by
those Actions) can place beans there in a Struts 1.0 based application.
Utilizing these capabilities, application developers will be able to
"script" the business logic requirements of many applications, by
combining functional logic already available as methods on business
logic beans, without having to involve Java programmers to create new
Actions (or otherwise synthesize business logic out of the constituent
pieces).</p>
<p>Components in the web layer integration may import APIs from the
Servlet and JSP specifications, but not from any application specific
framework. Framework-specific integration will occur on top of the
generic web layer integration.</p>
<p>In addition, the Struts integration will include a small custom tag
library will be included, so that page
developers can easily create navigational links and controls. Examples
of such controls include links to the "next", "previous", and "finish"
pages of a wizard dialog, a "cancel" button to exit a workflow early, or
an "invoke" button to invoke a new workflow as a subroutine, and then
return to the current step of the original workflow. Utilizing these
capabilities, page developers can create the individual visible pieces
of a work flow dialog, without having to be involved in navigational
complexities.</p>
</div>
</div>
<!--end main-->
</div>
<!--end content-->
<div id="footer">
<img id="powered-logo" alt="Powered by Struts" src="../images/struts-power.gif" />
Copyright (c) 2000-2005, The Apache Software Foundation <span class="noprint">-
<a href="http://wiki.apache.org/struts/StrutsDocComments">Comments?</a>
</span>
</div>
<!--end footer-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -