You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2004/03/01 12:00:44 UTC
cvs commit: cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/impl EventImpl.java ActionImpl.java
andreas 2004/03/01 03:00:43
Modified: src/blocks/workflow/java/org/apache/lenya/workflow
Action.java BooleanVariableInstance.java
WorkflowException.java BooleanVariable.java
WorkflowInstance.java Condition.java Workflow.java
WorkflowListener.java Transition.java Event.java
BooleanVariableAssignment.java
SynchronizedWorkflowInstances.java Situation.java
State.java
src/blocks/workflow/java/org/apache/lenya/workflow/impl
EventImpl.java ActionImpl.java
Log:
added more javadocs
Revision Changes Path
1.2 +4 -4 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Action.java
Index: Action.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Action.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Action.java 29 Feb 2004 17:34:46 -0000 1.1
+++ Action.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,16 +57,16 @@
/**
+ * Workflow action.
*
- * @author andreas
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface Action {
/**
* Executes this action for a given workflow instance.
- *
* @param instance the workflow instance
- *
* @throws WorkflowException if the execution failed
*/
void execute(WorkflowInstance instance) throws WorkflowException;
1.2 +5 -2 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/BooleanVariableInstance.java
Index: BooleanVariableInstance.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/BooleanVariableInstance.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BooleanVariableInstance.java 29 Feb 2004 17:34:46 -0000 1.1
+++ BooleanVariableInstance.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,10 +57,13 @@
/**
+ * An instance of a boolean variable.
*
- * @author andreas
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface BooleanVariableInstance {
+
/**
* Sets the value of this variable.
* @param value A boolean value.
1.2 +4 -4 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/WorkflowException.java
Index: WorkflowException.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/WorkflowException.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WorkflowException.java 29 Feb 2004 17:34:46 -0000 1.1
+++ WorkflowException.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,10 +57,10 @@
/**
- * @author andreas
+ * Workflow exception.
*
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public class WorkflowException extends Exception {
/**
1.2 +11 -4 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/BooleanVariable.java
Index: BooleanVariable.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/BooleanVariable.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BooleanVariable.java 29 Feb 2004 17:34:46 -0000 1.1
+++ BooleanVariable.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,16 +57,23 @@
/**
+ * <p>Boolean state variable.</p>
+ * <p>
+ * A workflow schema can contain a set of state variables.
+ * For each instance, the state variables hold certain values.
+ * Values can be assigned during transitions, so a variable can
+ * change its value when a transition fires. Currently,
+ * the workflow supports only boolean state variables.
+ * </p>
*
- * @author andreas
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface BooleanVariable {
/**
* Returns the name of this variable.
- *
* @return the name
- *
*/
String getName();
1.2 +8 -2 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/WorkflowInstance.java
Index: WorkflowInstance.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/WorkflowInstance.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WorkflowInstance.java 29 Feb 2004 17:34:46 -0000 1.1
+++ WorkflowInstance.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -56,8 +56,14 @@
package org.apache.lenya.workflow;
/**
+ * <p>A workflow instance is an incarnation of a workflow schema. It consists of</p>
+ * <ul>
+ * <li>a current state,</li>
+ * <li>a mapping which assigns values to all state variables.</li>
+ * </ul>
*
- * @author andreas
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface WorkflowInstance {
/**
1.2 +4 -2 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Condition.java
Index: Condition.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Condition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Condition.java 29 Feb 2004 17:34:46 -0000 1.1
+++ Condition.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -56,8 +56,10 @@
package org.apache.lenya.workflow;
/**
+ * Workflow condition.
*
- * @author andreas
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface Condition {
1.2 +12 -3 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Workflow.java
Index: Workflow.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Workflow.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Workflow.java 29 Feb 2004 17:34:46 -0000 1.1
+++ Workflow.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -55,10 +55,19 @@
*/
package org.apache.lenya.workflow;
-
/**
+ * <p>A workflow schema.</p>
+ * <p>
+ * A workflow schema defines a state machine (deterministic finite
+ * automaton - DFA), consisting of
+ * </p>
+ * <ul>
+ * <li>states, including a marked initial state,</li>
+ * <li>transitions, and</li>
+ * <li>state variables.</li>
*
- * @author andreas
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface Workflow {
String NAMESPACE = "http://apache.org/cocoon/lenya/workflow/1.0";
1.2 +5 -2 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/WorkflowListener.java
Index: WorkflowListener.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/WorkflowListener.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- WorkflowListener.java 29 Feb 2004 17:34:46 -0000 1.1
+++ WorkflowListener.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,10 +57,13 @@
/**
- * @author andreas
+ * Workflow listener interface.
*
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface WorkflowListener {
+
/**
* This method is invoked when a transition has fired.
*
1.2 +20 -3 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Transition.java
Index: Transition.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Transition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Transition.java 29 Feb 2004 17:34:46 -0000 1.1
+++ Transition.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,8 +57,25 @@
/**
- *
- * @author andreas
+ * <p>
+ * A transition describes the switching of a workflow instance
+ * from one state to another. A transition has
+ * </p>
+ *
+ * <ul>
+ * <li>a source state,</li>
+ * <li>a destination state,</li>
+ * <li>an event,</li>
+ * <li>a set of conditions,</li>
+ * <li>a set of assignments.</li>
+ * </ul>
+ *
+ * <p>
+ * Additionally, a transition can be marked as synchronized.
+ * </p>
+ *
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface Transition {
1.3 +2 -1 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Event.java
Index: Event.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Event.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Event.java 1 Mar 2004 09:45:41 -0000 1.2
+++ Event.java 1 Mar 2004 11:00:43 -0000 1.3
@@ -50,10 +50,11 @@
*/
package org.apache.lenya.workflow;
-
/**
* A workflow event.
+ *
* @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface Event {
1.2 +4 -4 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/BooleanVariableAssignment.java
Index: BooleanVariableAssignment.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/BooleanVariableAssignment.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- BooleanVariableAssignment.java 29 Feb 2004 17:34:46 -0000 1.1
+++ BooleanVariableAssignment.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,10 +57,10 @@
/**
- * @author andreas
+ * Boolean variable assignment.
*
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface BooleanVariableAssignment extends Action {
}
1.2 +28 -1 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/SynchronizedWorkflowInstances.java
Index: SynchronizedWorkflowInstances.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/SynchronizedWorkflowInstances.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SynchronizedWorkflowInstances.java 29 Feb 2004 17:34:46 -0000 1.1
+++ SynchronizedWorkflowInstances.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -57,6 +57,33 @@
/**
+ * <p>
+ * Synchronized workflow instances.
+ * </p>
+ *
+ * <p>
+ * A set of workflow instances with the same workflow schema can be synchronized.
+ * If a transition in this schema is marked as synchronized, it can only be invoked
+ * on all instances in the set at the same time.
+ * </p>
+ *
+ * <p>
+ * When a workflow event is invoked on a set of synchronized workflow instances,
+ * the transition is invoked only if
+ * </p>
+ * <ul>
+ * <li>all instances are in the source state of the transition, and</li>
+ * <li>all conditions of the transition are complied for all instances.</li>
+ * </ul>
+ *
+ * <p>
+ * Then the transition is invoked for all instances in the set.
+ * </p>
+ * <p>
+ * A common usecase of this concept is the simultaneous publishing of
+ * a set of documents (all language versions of a document, a section, ...).
+ * </p>
+ *
* @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
*/
public interface SynchronizedWorkflowInstances {
1.2 +4 -2 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Situation.java
Index: Situation.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/Situation.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Situation.java 29 Feb 2004 17:34:46 -0000 1.1
+++ Situation.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -59,7 +59,9 @@
/**
* A situation contains all information that is needed to decide which
* workflow transitions can fire at a certain moment.
- * @author andreas
+ *
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface Situation {
}
1.2 +4 -3 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/State.java
Index: State.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/State.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- State.java 29 Feb 2004 17:34:46 -0000 1.1
+++ State.java 1 Mar 2004 11:00:43 -0000 1.2
@@ -55,10 +55,11 @@
*/
package org.apache.lenya.workflow;
-
/**
+ * Workflow state.
*
- * @author andreas
+ * @author <a href="mailto:andreas@apache.org">Andreas Hartmann</a>
+ * @version $Id$
*/
public interface State {
}
1.3 +5 -11 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/impl/EventImpl.java
Index: EventImpl.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/impl/EventImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EventImpl.java 1 Mar 2004 10:36:22 -0000 1.2
+++ EventImpl.java 1 Mar 2004 11:00:43 -0000 1.3
@@ -82,12 +82,8 @@
return getName();
}
- /**
- * DOCUMENT ME!
- *
- * @param otherObject DOCUMENT ME!
- *
- * @return DOCUMENT ME!
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object otherObject) {
boolean equals = false;
@@ -102,10 +98,8 @@
return equals;
}
- /**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
*/
public int hashCode() {
return getName().hashCode();
1.3 +3 -4 cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/impl/ActionImpl.java
Index: ActionImpl.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/workflow/java/org/apache/lenya/workflow/impl/ActionImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ActionImpl.java 1 Mar 2004 10:36:22 -0000 1.2
+++ ActionImpl.java 1 Mar 2004 11:00:43 -0000 1.3
@@ -77,9 +77,8 @@
private String id;
/**
- * DOCUMENT ME!
- *
- * @return DOCUMENT ME!
+ * Returns the action ID.
+ * @return A string.
*/
public String getId() {
return id;