Author: ajaquith
Date: Thu Jul  3 17:04:58 2008
New Revision: 673878

URL: http://svn.apache.org/viewvc?rev=673878&view=rev
Log:
Made most of the workflow package, except for the set/getAttributes methods in 
the Workflow class, serializable. In the 3.0 timeframe, the rest of the package 
will be made serializable, too.

Modified:
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java
    
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/DefaultUserProfile.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/UserProfile.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/AbstractStep.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Decision.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/DecisionQueue.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Fact.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Outcome.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleDecision.java
    
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleNotification.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Step.java
    incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Workflow.java
    
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/ApprovalWorkflowTest.java
    incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/TaskTest.java

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/UserManager.java Thu Jul 
 3 17:04:58 2008
@@ -713,6 +713,7 @@
      */
     public static class SaveUserProfileTask extends Task
     {
+        private static final long serialVersionUID = 6994297086560480285L;
         private final UserDatabase m_db;
         private final WikiEngine m_engine;
 

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/DefaultUserProfile.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/DefaultUserProfile.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/DefaultUserProfile.java 
(original)
+++ 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/DefaultUserProfile.java 
Thu Jul  3 17:04:58 2008
@@ -34,6 +34,8 @@
 
 public final class DefaultUserProfile implements UserProfile
 {
+    private static final long serialVersionUID = -5600466893735300647L;
+
     private static final String EMPTY_STRING = "";
 
     private static final String WHITESPACE = "\\s";

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/UserProfile.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/UserProfile.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/UserProfile.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/auth/user/UserProfile.java 
Thu Jul  3 17:04:58 2008
@@ -34,7 +34,7 @@
  * @author Andrew Jaquith
  * @since 2.3
  */
-public interface UserProfile
+public interface UserProfile extends Serializable
 {
 
     /**

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/AbstractStep.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/AbstractStep.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/AbstractStep.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/AbstractStep.java 
Thu Jul  3 17:04:58 2008
@@ -20,6 +20,7 @@
  */
 package com.ecyrd.jspwiki.workflow;
 
+import java.io.Serializable;
 import java.security.Principal;
 import java.util.*;
 
@@ -145,11 +146,11 @@
     /**
      * [EMAIL PROTECTED]
      */
-    public final Object[] getMessageArguments()
+    public final Serializable[] getMessageArguments()
     {
         if ( m_workflow == null )
         {
-            return new Object[0];
+            return new Serializable[0];
         }
         return m_workflow.getMessageArguments();
     }

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Decision.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Decision.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Decision.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Decision.java Thu 
Jul  3 17:04:58 2008
@@ -31,16 +31,16 @@
  * <p>
  * AbstractStep subclass that asks an actor Principal to choose an Outcome on
  * behalf of an owner (also a Principal). The actor "makes the decision" by
- * calling the [EMAIL PROTECTED] #decide(Outcome)} method. When this method is 
called,
- * it will set the Decision's Outcome to the one supplied. If the parent
- * Workflow is in the [EMAIL PROTECTED] Workflow#WAITING} state, it will be 
re-started.
- * Any checked WikiExceptions thrown by the workflow after re-start will be
- * re-thrown to callers.
+ * calling the [EMAIL PROTECTED] #decide(Outcome)} method. When this method is 
called, it
+ * will set the Decision's Outcome to the one supplied. If the parent Workflow
+ * is in the [EMAIL PROTECTED] Workflow#WAITING} state, it will be re-started. 
Any checked
+ * WikiExceptions thrown by the workflow after re-start will be re-thrown to
+ * callers.
  * </p>
  * <p>
- * When a Decision completes, its
- * [EMAIL PROTECTED] #isCompleted()} method returns <code>true</code>. It also 
tells its
- * parent WorkflowManager to remove it from the list of pending tasks by 
calling
+ * When a Decision completes, its [EMAIL PROTECTED] #isCompleted()} method 
returns
+ * <code>true</code>. It also tells its parent WorkflowManager to remove it
+ * from the list of pending tasks by calling
  * [EMAIL PROTECTED] DecisionQueue#remove(Decision)}.
  * </p>
  * <p>
@@ -48,7 +48,8 @@
  * arbitrary key-value pairs called "facts." These facts can be presented by 
the
  * user interface to show details the actor needs to know about. Facts are 
added
  * by calling classes to the Decision, in order of expected presentation, by 
the
- * [EMAIL PROTECTED] #addFact(Fact)} method. They can be retrieved, in order, 
via [EMAIL PROTECTED] #getFacts()}.
+ * [EMAIL PROTECTED] #addFact(Fact)} method. They can be retrieved, in order, 
via
+ * [EMAIL PROTECTED] #getFacts()}.
  * </p>
  *
  * @author Andrew Jaquith
@@ -65,63 +66,69 @@
     private final List<Fact> m_facts;
 
     /**
-     * Constructs a new Decision for a required "actor" Principal, having a 
default Outcome.
+     * Constructs a new Decision for a required "actor" Principal, having a
+     * default Outcome.
+     * 
      * @param workflow the parent Workflow object
-     * @param messageKey the i18n message key that represents the message the 
actor will see
-     * @param actor the Principal (<em>e.g.</em>, a WikiPrincipal, Role, 
GroupPrincipal) who is
-     * required to select an appropriate Outcome
-     * @param defaultOutcome the Outcome that the user interface will 
recommend as the
-     * default choice
+     * @param messageKey the i18n message key that represents the message the
+     *            actor will see
+     * @param actor the Principal (<em>e.g.</em>, a WikiPrincipal, Role,
+     *            GroupPrincipal) who is required to select an appropriate
+     *            Outcome
+     * @param defaultOutcome the Outcome that the user interface will recommend
+     *            as the default choice
      */
-    public Decision(Workflow workflow, String messageKey, Principal actor, 
Outcome defaultOutcome)
+    public Decision( Workflow workflow, String messageKey, Principal actor, 
Outcome defaultOutcome )
     {
-        super(workflow, messageKey);
+        super( workflow, messageKey );
         m_actor = actor;
         m_defaultOutcome = defaultOutcome;
         m_facts = new ArrayList<Fact>();
-        addSuccessor(defaultOutcome, null);
+        addSuccessor( defaultOutcome, null );
     }
 
     /**
      * Appends a Fact to the list of Facts associated with this Decision.
-     *
-     * @param fact
-     *            the new fact to add
-     */
-    public final void addFact(Fact fact)
-    {
-        m_facts.add(fact);
+     * 
+     * @param fact the new fact to add
+     */
+    public final void addFact( Fact fact )
+    {
+        m_facts.add( fact );
     }
 
     /**
-     * <p>Sets this Decision's outcome, and restarts the parent Workflow if
-     * it is in the [EMAIL PROTECTED] Workflow#WAITING} state and this 
Decision is
-     * its currently active Step. Any checked WikiExceptions thrown by
-     * the workflow after re-start will be re-thrown to callers.</p>
-     * <p>This method cannot be invoked if the Decision is not the
-     * current Workflow step; all other invocations will throw
-     * an IllegalStateException. If the Outcome supplied to this method
-     * is one one of the Outcomes returned by [EMAIL PROTECTED] 
#getAvailableOutcomes()},
-     * an IllegalArgumentException will be thrown.</p>
-     *
-     * @param outcome
-     *            the Outcome of the Decision
-     * @throws WikiException
-     *             if the act of restarting the Workflow throws an exception
+     * <p>
+     * Sets this Decision's outcome, and restarts the parent Workflow if it is
+     * in the [EMAIL PROTECTED] Workflow#WAITING} state and this Decision is 
its currently
+     * active Step. Any checked WikiExceptions thrown by the workflow after
+     * re-start will be re-thrown to callers.
+     * </p>
+     * <p>
+     * This method cannot be invoked if the Decision is not the current 
Workflow
+     * step; all other invocations will throw an IllegalStateException. If the
+     * Outcome supplied to this method is one one of the Outcomes returned by
+     * [EMAIL PROTECTED] #getAvailableOutcomes()}, an IllegalArgumentException 
will be
+     * thrown.
+     * </p>
+     * 
+     * @param outcome the Outcome of the Decision
+     * @throws WikiException if the act of restarting the Workflow throws an
+     *             exception
      */
-    public void decide(Outcome outcome) throws WikiException
+    public void decide( Outcome outcome ) throws WikiException
     {
-        super.setOutcome(outcome);
+        super.setOutcome( outcome );
 
         // If current workflow is waiting for input, restart it and remove
         // Decision from DecisionQueue
         Workflow w = getWorkflow();
-        if (w.getCurrentState() == Workflow.WAITING && 
this.equals(w.getCurrentStep()))
+        if( w.getCurrentState() == Workflow.WAITING && this.equals( 
w.getCurrentStep() ) )
         {
             WorkflowManager wm = w.getWorkflowManager();
-            if (wm != null)
+            if( wm != null )
             {
-                wm.getDecisionQueue().remove(this);
+                wm.getDecisionQueue().remove( this );
             }
             // Restart workflow
             w.restart();
@@ -133,21 +140,22 @@
      * if the current Outcome isn't a completion (which will be true if the
      * [EMAIL PROTECTED] #decide(Outcome)} method hasn't been executed yet. 
This method
      * will also add the Decision to the associated DecisionQueue.
+     * 
      * @return the Outcome of the execution
      * @throws WikiException never
      */
     public Outcome execute() throws WikiException
     {
-        if (getOutcome().isCompletion())
+        if( getOutcome().isCompletion() )
         {
             return getOutcome();
         }
 
         // Put decision in the DecisionQueue
         WorkflowManager wm = getWorkflow().getWorkflowManager();
-        if (wm != null)
+        if( wm != null )
         {
-            wm.getDecisionQueue().add(this);
+            wm.getDecisionQueue().add( this );
         }
 
         // Indicate we are waiting for user input
@@ -166,7 +174,7 @@
      * Returns the default or suggested outcome, which must be one of those
      * returned by [EMAIL PROTECTED] #getAvailableOutcomes()}. This method is 
guaranteed
      * to return a non-<code>null</code> Outcome.
-     *
+     * 
      * @return the default outcome.
      */
     public Outcome getDefaultOutcome()
@@ -177,19 +185,19 @@
     /**
      * Returns the Facts associated with this Decision, in the order in which
      * they were added.
-     *
+     * 
      * @return the list of Facts
      */
     public final List getFacts()
     {
-        return Collections.unmodifiableList(m_facts);
+        return Collections.unmodifiableList( m_facts );
     }
 
     /**
      * Returns the unique identifier for this Decision. Normally, this ID is
      * programmatically assigned when the Decision is added to the
      * DecisionQueue.
-     *
+     * 
      * @return the identifier
      */
     public final int getId()
@@ -200,7 +208,7 @@
     /**
      * Returns <code>true</code> if the Decision can be reassigned to another
      * actor. This implementation always returns <code>true</code>.
-     *
+     * 
      * @return the result
      */
     public boolean isReassignable()
@@ -209,31 +217,30 @@
     }
 
     /**
-     * Reassigns the Decision to a new actor (that is, provide an outcome).
-     * If the Decision is not reassignable, this method throws 
-     * an IllegalArgumentException.
-     *
+     * Reassigns the Decision to a new actor (that is, provide an outcome). If
+     * the Decision is not reassignable, this method throws an
+     * IllegalArgumentException.
+     * 
      * @param actor the actor to reassign the Decision to
      */
-    public final synchronized void reassign(Principal actor)
+    public final synchronized void reassign( Principal actor )
     {
-        if (isReassignable())
+        if( isReassignable() )
         {
             m_actor = actor;
         }
         else
         {
-            throw new IllegalArgumentException("Decision cannot be 
reassigned.");
+            throw new IllegalArgumentException( "Decision cannot be 
reassigned." );
         }
     }
 
     /**
      * Sets the unique identfier for this Decision.
-     *
-     * @param id
-     *            the identifier
+     * 
+     * @param id the identifier
      */
-    public final void setId(int id)
+    public final void setId( int id )
     {
         m_id = id;
     }

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/DecisionQueue.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/DecisionQueue.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/DecisionQueue.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/DecisionQueue.java 
Thu Jul  3 17:04:58 2008
@@ -20,6 +20,7 @@
  */
 package com.ecyrd.jspwiki.workflow;
 
+import java.io.Serializable;
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -35,8 +36,9 @@
  * @author Andrew Jaquith
  * @since 2.5
  */
-public class DecisionQueue
+public class DecisionQueue implements Serializable
 {
+    private static final long serialVersionUID = -7172912793410302533L;
 
     private LinkedList<Decision> m_queue = new LinkedList<Decision>();
 

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Fact.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Fact.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Fact.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Fact.java Thu Jul  3 
17:04:58 2008
@@ -20,21 +20,25 @@
  */
 package com.ecyrd.jspwiki.workflow;
 
+import java.io.Serializable;
+
 /**
- * Represents a contextual artifact, which can be any Object, useful for making
+ * Represents a contextual artifact, which can be any serializable object, 
useful for making
  * a Decision. Facts are key-value pairs, where the key is a String (message
- * key) and the value is an arbitrary Object. Generally, the supplied object's
+ * key) and the value is an arbitrary object. Generally, the supplied object's
  * [EMAIL PROTECTED] #toString()} method should return a human-readable 
String. Facts are
  * immutable objects.
  * 
  * @author Andrew Jaquith
  * @since 2.5
  */
-public final class Fact
+public final class Fact implements Serializable
 {
+    private static final long serialVersionUID = -7459432935402796978L;
+
     private final String m_key;
 
-    private final Object m_obj;
+    private final Serializable m_obj;
 
     /**
      * Constructs a new Fact with a supplied message key and value.
@@ -44,7 +48,7 @@
      * @param value
      *            the object to associate with the name
      */
-    public Fact(String messageKey, Object value)
+    public Fact(String messageKey, Serializable value)
     {
         if ( messageKey == null || value == null )
         {
@@ -67,7 +71,7 @@
      * Returns this Fact's value.
      * @return the value object
      */
-    public Object getValue()
+    public Serializable getValue()
     {
         return m_obj;
     }

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Outcome.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Outcome.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Outcome.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Outcome.java Thu Jul 
 3 17:04:58 2008
@@ -20,6 +20,8 @@
  */
 package com.ecyrd.jspwiki.workflow;
 
+import java.io.Serializable;
+
 /**
  * Resolution of a workflow Step, such as "approve," "deny," "hold," "task
  * error," or other potential resolutions.
@@ -27,9 +29,11 @@
  * @author Andrew Jaquith
  * @since 2.5
  */
-public final class Outcome
+public final class Outcome implements Serializable
 {
 
+    private static final long serialVersionUID = -338361947886288073L;
+
     /** Complete workflow step (without errors) */
     public static final Outcome STEP_COMPLETE = new Outcome( 
"outcome.step.complete", true );
 

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleDecision.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleDecision.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleDecision.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleDecision.java 
Thu Jul  3 17:04:58 2008
@@ -33,6 +33,8 @@
 public class SimpleDecision extends Decision
 {
 
+    private static final long serialVersionUID = 8192213077644617341L;
+
     /**
      * Constructs a new SimpleDecision assigned to a specified actor.
      * @param workflow the parent Workflow

Modified: 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleNotification.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleNotification.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleNotification.java 
(original)
+++ 
incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/SimpleNotification.java 
Thu Jul  3 17:04:58 2008
@@ -35,6 +35,8 @@
 public final class SimpleNotification extends Decision
 {
 
+    private static final long serialVersionUID = -3392947495169819527L;
+
     /**
      * Constructs a new SimpleNotification object with a supplied message key,
      * associated Workflow, and named actor who must acknowledge the message.

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Step.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Step.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Step.java (original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Step.java Thu Jul  3 
17:04:58 2008
@@ -20,6 +20,7 @@
  */
 package com.ecyrd.jspwiki.workflow;
 
+import java.io.Serializable;
 import java.security.Principal;
 import java.util.Collection;
 import java.util.Date;
@@ -61,7 +62,7 @@
  * @author Andrew Jaquith
  * @since 2.5
  */
-public interface Step
+public interface Step extends Serializable
 {
 
     /**
@@ -117,8 +118,7 @@
      * multiple times.
      * </p>
      * 
-     * @return the result of the Step, where <code>true</code> means success,
-     *         and <code>false</code> means abort
+     * @return the result of the Step, expressed as an Outcome
      * @throws WikiException
      *             if the step encounters errors while executing
      */
@@ -156,7 +156,7 @@
      * 
      * @return the message arguments.
      */
-    public Object[] getMessageArguments();
+    public Serializable[] getMessageArguments();
 
     /**
      * Returns the Outcome of this Step's processing; by default,

Modified: incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Workflow.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Workflow.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Workflow.java 
(original)
+++ incubator/jspwiki/trunk/src/com/ecyrd/jspwiki/workflow/Workflow.java Thu 
Jul  3 17:04:58 2008
@@ -20,6 +20,7 @@
  */
 package com.ecyrd.jspwiki.workflow;
 
+import java.io.Serializable;
 import java.security.Principal;
 import java.util.*;
 
@@ -198,8 +199,10 @@
  *
  * @author Andrew Jaquith
  */
-public class Workflow
+public class Workflow implements Serializable
 {
+    private static final long serialVersionUID = 5228149040690660032L;
+
     /** Time value: the start or end time has not been set. */
     public static final Date TIME_NOT_SET = new Date( 0 );
 
@@ -241,7 +244,7 @@
 
     private final Principal m_owner;
 
-    private final List<Object> m_messageArgs;
+    private final List<Serializable> m_messageArgs;
 
     private int m_state;
 
@@ -272,7 +275,7 @@
         m_id = ID_NOT_SET;
         m_key = messageKey;
         m_manager = null;
-        m_messageArgs = new ArrayList<Object>();
+        m_messageArgs = new ArrayList<Serializable>();
         m_owner = owner;
         m_started = false;
         m_state = CREATED;
@@ -325,7 +328,7 @@
      * an IllegalArgumentException.
      * @param obj the object to add
      */
-    public final void addMessageArgument( Object obj )
+    public final void addMessageArgument( Serializable obj )
     {
         if ( obj instanceof String || obj instanceof Date || obj instanceof 
Number )
         {
@@ -435,19 +438,19 @@
      * </ul>
      * <p>
      * Workflow and Step subclasses are free to append items to this collection
-     * with [EMAIL PROTECTED] #addMessageArgument(Object)}.
+     * with [EMAIL PROTECTED] #addMessageArgument(Serializable)}.
      * </p>
      *
      * @return the array of message arguments
      */
-    public final Object[] getMessageArguments()
+    public final Serializable[] getMessageArguments()
     {
-        List<Object> args = new ArrayList<Object>();
+        List<Serializable> args = new ArrayList<Serializable>();
         args.add( m_owner.getName() );
         Principal actor = getCurrentActor();
         args.add( actor == null ? "-" : actor.getName() );
         args.addAll( m_messageArgs );
-        return args.toArray( new Object[args.size()] );
+        return args.toArray( new Serializable[args.size()] );
     }
 
     /**
@@ -589,17 +592,17 @@
     }
 
     /**
-     * Temporarily associates an Object with this Workflow, as a named 
attribute, for the
-     * duration of workflow execution. The passed Object can be anything 
required by
-     * an executing Step. Note that when the workflow completes or aborts, all
-     * attributes will be cleared.
+     * Temporarily associates an object with this Workflow, as a named 
attribute, for the
+     * duration of workflow execution. The passed object can be anything 
required by
+     * an executing Step, although it <em>should</em> be serializable. Note 
that when the workflow
+     * completes or aborts, all attributes will be cleared.
      *
      * @param attr
      *            the attribute name
      * @param obj
      *            the value
      */
-    public final synchronized void setAttribute(String attr, Object obj)
+    public final synchronized void setAttribute(String attr, Object obj )
     {
         if ( m_attributes == null )
         {

Modified: 
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/ApprovalWorkflowTest.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/ApprovalWorkflowTest.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- 
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/ApprovalWorkflowTest.java
 (original)
+++ 
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/ApprovalWorkflowTest.java
 Thu Jul  3 17:04:58 2008
@@ -258,6 +258,7 @@
      */
     public static class TestPrepTask extends Task
     {
+        private static final long serialVersionUID = 1L;
 
         public TestPrepTask( String messageKey )
         {

Modified: incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/TaskTest.java
URL: 
http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/TaskTest.java?rev=673878&r1=673877&r2=673878&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/TaskTest.java 
(original)
+++ incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/workflow/TaskTest.java Thu 
Jul  3 17:04:58 2008
@@ -17,6 +17,8 @@
     /** Sample Task that completes normally. */
     public static class NormalTask extends Task
     {
+        private static final long serialVersionUID = 1L;
+
         public NormalTask(Workflow workflow)
         {
             super(workflow, "task.normal");
@@ -31,6 +33,8 @@
     /** Sample Task that encounters an error during processing. */
     public static class ErrorTask extends Task
     {
+        private static final long serialVersionUID = 1L;
+
         public ErrorTask(Workflow workflow)
         {
             super(workflow, "task.error");


Reply via email to