You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2012/04/28 05:53:26 UTC

svn commit: r1331673 - /oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowState.java

Author: mattmann
Date: Sat Apr 28 03:53:26 2012
New Revision: 1331673

URL: http://svn.apache.org/viewvc?rev=1331673&view=rev
Log:
- OODT-310 and OODT-215: Generic WorkflowState class. Unlike the wengine-branch, this is *not* an abstract class, intended to be inherited from and to statically type and define workflow states. Instead, it's a simple POJO container, configured by WorkflowLifeCycle to dynamically represent workflow state in a configurable way.

Added:
    oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowState.java

Added: oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowState.java
URL: http://svn.apache.org/viewvc/oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowState.java?rev=1331673&view=auto
==============================================================================
--- oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowState.java (added)
+++ oodt/trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/lifecycle/WorkflowState.java Sat Apr 28 03:53:26 2012
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.oodt.cas.workflow.lifecycle;
+
+//JDK imports
+import java.util.Date;
+import java.util.Vector;
+
+/**
+ * 
+ * The state of a WorkflowProcessor
+ * 
+ * @author bfoster
+ * @author mattmann
+ * @version $Revision$
+ * 
+ */
+public class WorkflowState {
+
+  private String name;
+  private String description;
+	private String message;
+	private Vector<WorkflowState> subStates;
+	private Date startTime;
+	private WorkflowLifecycleStage category;
+	private WorkflowState prevState;
+	
+	
+	public WorkflowState(){
+	  this.subStates = new Vector<WorkflowState>();
+	  this.startTime = null;
+	  this.name = null;
+	  this.description = null;
+	  this.message = null;
+	  this.category = null;
+	  this.prevState = null;
+	}
+	
+	public WorkflowState(String message) {
+	  this();
+		this.message = message;
+		this.startTime = new Date();
+	}
+	
+	public void setMessage(String message){
+	  this.message = message;
+	}
+	
+	public void setStartTime(Date startTime){
+	  this.startTime = startTime;
+	}
+	
+	public String getMessage() {
+		return this.message;
+	}
+	
+	public Date getStartTime() {
+		return this.startTime;
+	}
+	
+	public boolean equals(Object obj) {
+		if (obj instanceof WorkflowState) 
+			return ((WorkflowState) obj).getName().equals(this.getName());
+		else
+			return false;
+	}
+		
+	public String toString() {
+		return this.getName() + " : " + this.getMessage();
+	}
+
+  /**
+   * @return the name
+   */
+  public String getName() {
+    return name;
+  }
+
+  /**
+   * @param name the name to set
+   */
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  /**
+   * @return the description
+   */
+  public String getDescription() {
+    return description;
+  }
+
+  /**
+   * @param description the description to set
+   */
+  public void setDescription(String description) {
+    this.description = description;
+  }
+
+  /**
+   * @return the subStates
+   */
+  public Vector<WorkflowState> getSubStates() {
+    return subStates;
+  }
+
+  /**
+   * @param subStates the subStates to set
+   */
+  public void setSubStates(Vector<WorkflowState> subStates) {
+    this.subStates = subStates;
+  }
+
+  /**
+   * @return the category
+   */
+  public WorkflowLifecycleStage getCategory() {
+    return category;
+  }
+
+  /**
+   * @param category the category to set
+   */
+  public void setCategory(WorkflowLifecycleStage category) {
+    this.category = category;
+  }
+
+  /**
+   * @return the prevState
+   */
+  public WorkflowState getPrevState() {
+    return prevState;
+  }
+
+  /**
+   * @param prevState the prevState to set
+   */
+  public void setPrevState(WorkflowState prevState) {
+    this.prevState = prevState;
+  }
+	
+}