Java Reference
In-Depth Information
try
{
Class cls
#
obj.getClass();
Constructor cpyCtor
#
cls.getConstructor(new Class[]{ cls });
return
cpyCtor.newInstance(new Object[]{ obj });
}
catch
(Exception e){
// if there's no copy constructor return the string
// equivalent
return
obj.toString();
}
}
...
}
The
WorkItem.jsp
page now includes a section that contains a text area for
each of the data items accessible in the activity. We use the
<textarea>
tag
because in this prototype the only valid data type is
String
.
<%@
page contentType
#
"text/html" language
#
"java"
%>
...
<hr><h2>
Activity data
</h2>
<form
action
#
"Complete.jsp" method
#
"POST">
<%
NameValue[] processContext
#
activity.
process_context();
for
(
int
i
#
0; i<processContext.length;
!!
i){
%>
<%
#
processContext[i].the_name
%>
:
<br>
<textarea
name
#
"
<%
#
processContext[i].the_name
%>
"
>
<%
#
processContext[i].the_value
%></textarea>
<p><%
}
%>
<input
type
#
"hidden" name
#
"workItem" value
#
"
<%
#
key
%>
">
<input
type
#
"submit" name
#
"action" value
#
"Complete">
<input
type
#
"submit" name
#
"action" value
#
"Update">
</form>
...
</html>
21.7.4
Test
The test procedure is the same as the previous prototype. In addition it is
important to test the input of the workflow data for each activity.
21.8
■
Extension
The workflow management system developed so far did not address two
issues that are important for a system that can be used to enact real business