You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-dev@ws.apache.org by ki...@apache.org on 2005/08/02 15:57:38 UTC

svn commit: r227004 - /webservices/muse/trunk/src/examples/enterprise/logic/src/java/org/apache/ws/muse/example/businessprocesstype/backend/BusinessProcessInstance.java

Author: kidz
Date: Tue Aug  2 06:57:36 2005
New Revision: 227004

URL: http://svn.apache.org/viewcvs?rev=227004&view=rev
Log:
Added complete operation

Modified:
    webservices/muse/trunk/src/examples/enterprise/logic/src/java/org/apache/ws/muse/example/businessprocesstype/backend/BusinessProcessInstance.java

Modified: webservices/muse/trunk/src/examples/enterprise/logic/src/java/org/apache/ws/muse/example/businessprocesstype/backend/BusinessProcessInstance.java
URL: http://svn.apache.org/viewcvs/webservices/muse/trunk/src/examples/enterprise/logic/src/java/org/apache/ws/muse/example/businessprocesstype/backend/BusinessProcessInstance.java?rev=227004&r1=227003&r2=227004&view=diff
==============================================================================
--- webservices/muse/trunk/src/examples/enterprise/logic/src/java/org/apache/ws/muse/example/businessprocesstype/backend/BusinessProcessInstance.java (original)
+++ webservices/muse/trunk/src/examples/enterprise/logic/src/java/org/apache/ws/muse/example/businessprocesstype/backend/BusinessProcessInstance.java Tue Aug  2 06:57:36 2005
@@ -31,10 +31,7 @@
    private Random    m_time               = new Random(  );
    private long      m_cumulativeTime     = 0L;
    private long      m_totProcesses       = 0L;
-   private long      m_totCompProcesses   = 0L;
-   private long      m_totAbortProcesses  = 0L;
    private int       m_runningProcesses   = 0;
-   private int       m_suspendProcesses   = 0;
    private ArrayList m_allprocessesIds    = new ArrayList(  );
    private ArrayList m_runProcesses       = new ArrayList(  );
    private ArrayList m_suspProcesses      = new ArrayList(  );
@@ -144,6 +141,29 @@
          }
       }
    }
+   
+   /**
+    * DOCUMENT_ME
+    *
+    * @param processId DOCUMENT_ME
+    */
+   public void complete( String processId )
+   {
+      //		 Check if the id is a valid Id
+      boolean exists = m_allprocessesIds.contains( processId );
+      if ( exists )
+      {
+         // Check if the process is running
+         if ( m_runProcesses.contains( processId ) )
+         {
+            //Remove the process to running list
+         	m_runProcesses.remove( processId );
+
+            // Move the process to completed list
+            m_completedProcesses.add( processId );
+         }
+      }
+   }
 
    /**
     * DOCUMENT_ME
@@ -159,11 +179,12 @@
          // Check if the process is not already suspended
          if ( !m_suspProcesses.contains( processId ) )
          {
-            //Move the process to suspended list
-            m_suspProcesses.add( processId );
-
-            // remove the process from running list
+         	 // remove the process from running list
             m_runProcesses.remove( processId );
+            
+         	//Move the process to suspended list
+            m_suspProcesses.add( processId );
+           
          }
       }
    }
@@ -191,6 +212,7 @@
             // Move the process from running list
             m_runProcesses.remove( processId );
          }
+         m_termProcesses.add( processId );
       }
    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-dev-help@ws.apache.org