Index: sandbox/workflow/branches/609/lib/factory/BaseFactory.php
===================================================================
--- sandbox/workflow/branches/609/lib/factory/BaseFactory.php	(revision 2278)
+++ sandbox/workflow/branches/609/lib/factory/BaseFactory.php	(revision 2291)
@@ -34,4 +34,8 @@
 	 * atribute.
 	 *
+	 * @param string $className Class name.
+	 * @param string $fileName Name of the file that contains the class definition.
+	 * @param string $relativePath The path to the file, relative to $basePath.
+	 * @param string $basePath Base path to append $relativePath. Optional.
 	 * @access protected
 	 * @return void
@@ -55,4 +59,6 @@
 	 * pointers (&) to avoid object duplications.
 	 *
+	 * @param string $className Name of the class.
+	 * @param array $classArgs Parameters to the class's constructor.
 	 * @access public
 	 * @return object
@@ -90,4 +96,6 @@
 	 * @todo Maybe we don't have to use the reflection
 	 *		 class here. Future work...
+	 * @param string $className Name of the class.
+	 * @param array $classArgs Parameters to the class's constructor.
 	 * @access public
 	 * @return object
@@ -121,4 +129,5 @@
 	 * '$_fileInfo' array.
 	 *
+	 * @param string $className Key to search for into the internal cache.
 	 * @access private
 	 * @return array
@@ -133,4 +142,6 @@
 	 * for upcoming requests.
 	 *
+	 * @param string $className Name of the class.
+	 * @param object Object whose reference will be stored.
 	 * @access private
 	 * @return boolean
@@ -150,4 +161,5 @@
 	 * it could be the only place to include files.
 	 *
+	 * @param string $className Key to search for into internal cache.
 	 * @access private
 	 * @return boolean
Index: sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php
===================================================================
--- sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php	(revision 2278)
+++ sandbox/workflow/branches/609/lib/factory/WorkflowFactory.php	(revision 2291)
@@ -52,4 +52,6 @@
 		$this->registerFileInfo('WorkflowLDAP', 'class.WorkflowLDAP.inc.php', 'inc');
 		$this->registerFileInfo('WorkflowSecurity', 'class.WorkflowSecurity.inc.php', 'inc');
+		$this->registerFileInfo('WorkflowMacro', 'class.WorkflowMacro.inc.php', 'inc');
+		$this->registerFileInfo('WorkflowJobManager', 'class.WorkflowJobManager.inc.php', 'inc');
 		$this->registerFileInfo('ResourcesRedirector', 'class.ResourcesRedirector.inc.php', 'inc');
 		$this->registerFileInfo('TemplateServer', 'class.TemplateServer.inc.php', 'inc');
@@ -57,4 +59,6 @@
 		$this->registerFileInfo('BrowserInfo', 'class.BrowserInfo.inc.php', 'inc');
 		$this->registerFileInfo('JobScheduler', 'class.JobScheduler.inc.php', 'inc');
+		$this->registerFileInfo('Thread', 'class.Thread.inc.php', 'inc');
+		$this->registerFileInfo('Paging', 'class.Paging.inc.php', 'inc');
 		$this->registerFileInfo('UserPictureProvider', 'class.UserPictureProvider.inc.php', 'inc');
 
@@ -63,11 +67,14 @@
 		$this->registerFileInfo('workflow_smarty', 'class.workflow_smarty.inc.php', 'inc');
 		$this->registerFileInfo('workflow_acl', 'class.workflow_acl.inc.php', 'inc');
+		$this->registerFileInfo('workflow_process', 'class.workflow_process.inc.php', 'inc');
 		$this->registerFileInfo('workflow_processmanager', 'class.workflow_processmanager.inc.php', 'inc');
 		$this->registerFileInfo('workflow_wfruntime', 'class.workflow_wfruntime.inc.php', 'inc');
 		$this->registerFileInfo('workflow_gui', 'class.workflow_gui.inc.php', 'inc');
 		$this->registerFileInfo('workflow_rolemanager', 'class.workflow_rolemanager.inc.php', 'inc');
+		$this->registerFileInfo('workflow_baseactivity', 'class.workflow_baseactivity.inc.php', 'inc');
 		$this->registerFileInfo('workflow_activitymanager', 'class.workflow_activitymanager.inc.php', 'inc');
 		$this->registerFileInfo('workflow_instance', 'class.workflow_instance.inc.php', 'inc');
 
+		$this->registerFileInfo('bo_userinterface', 'class.bo_userinterface.inc.php', 'inc');
 		$this->registerFileInfo('bo_participants', 'class.bo_participants.inc.php', 'inc');
 		$this->registerFileInfo('bo_agent_mail_smtp', 'class.bo_agent_mail_smtp.inc.php', 'inc');
@@ -77,6 +84,6 @@
 
 		/* registering egw external classes */
-		$this->registerFileInfo('phpgw', 'class.phpgw.inc.php', '', EGW_INC_ROOT);
 		$this->registerFileInfo('db', 'class.db.inc.php', '', EGW_INC_ROOT);
+		$this->registerFileInfo('acl', 'class.acl.inc.php', '', EGW_INC_ROOT);
 		$this->registerFileInfo('accounts', 'class.accounts.inc.php', '', EGW_INC_ROOT);
 		$this->registerFileInfo('config', 'class.config.inc.php', '', EGW_INC_ROOT);
Index: sandbox/workflow/branches/609/lib/factory/Factory.php
===================================================================
--- sandbox/workflow/branches/609/lib/factory/Factory.php	(revision 2278)
+++ sandbox/workflow/branches/609/lib/factory/Factory.php	(revision 2291)
@@ -90,4 +90,6 @@
 	 * values are 'getInstance' and 'newInstance'.
 	 *
+	 * @param string $methodName Name of the BaseFactory method to call.
+	 * @param array $args Parameters to class's constructor.
 	 * @access private
 	 * @return object
Index: sandbox/workflow/branches/609/lib/factory/ProcessWrapperFactory.php
===================================================================
--- sandbox/workflow/branches/609/lib/factory/ProcessWrapperFactory.php	(revision 2258)
+++ sandbox/workflow/branches/609/lib/factory/ProcessWrapperFactory.php	(revision 2291)
@@ -23,14 +23,36 @@
 {
 
+	/**
+	 * Just forward the call.
+	 *
+	 * @access public
+	 * @return object
+	 */
 	public function &getInstance() {
 
 		$args = func_get_args();
+
+		/**
+		 * To save memory and processing, we store caches of objects instantiated
+		 * by the factory. When we use this beautiful function (call_user_func_array),
+		 * it makes an unexpected copy of the object. Of course we don't want it.
+		 * For now, we will keep doing copies.
+		 */
 		return call_user_func_array(array(Factory, "getInstance"), $args);
 
 	}
 
+
+	/**
+	 * Just forward the call.
+	 *
+	 * @access public
+	 * @return object
+	 */
 	public function &newInstance() {
 
 		$args = func_get_args();
+
+		/* read the comment above */
 		return call_user_func_array(array(Factory, "newInstance"), $args);
 
Index: sandbox/workflow/branches/609/lib/security/Security.php
===================================================================
--- sandbox/workflow/branches/609/lib/security/Security.php	(revision 2258)
+++ sandbox/workflow/branches/609/lib/security/Security.php	(revision 2291)
@@ -90,4 +90,5 @@
 	 * previous function.
 	 *
+	 * @param integer $depth The deepness of the fileName in backtrace.
 	 * @access public
 	 * @return boolean
Index: sandbox/workflow/branches/609/inc/engine/config.egw.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/engine/config.egw.inc.php	(revision 2264)
+++ sandbox/workflow/branches/609/inc/engine/config.egw.inc.php	(revision 2291)
@@ -305,5 +305,5 @@
 		{
 			// This way we create a new run_activity instance for the next activity
-			$run_activity = Factory::getInstance('workflow.run_activity.go');
+			$run_activity = Factory::getInstance('run_activity');
 			$data = $run_activity->go($activityId, $iid, $auto);
 			return $data;
Index: sandbox/workflow/branches/609/inc/class.so_adminaccess.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.so_adminaccess.inc.php	(revision 2233)
+++ sandbox/workflow/branches/609/inc/class.so_adminaccess.inc.php	(revision 2291)
@@ -202,5 +202,5 @@
 		{
 			$GLOBALS['phpgw']->db =& Factory::getInstance('WorkflowObjects')->getDBExpresso();
-			$GLOBALS['phpgw']->acl =& Factory::getForeignInstance('phpgwapi', 'acl', $userID);
+			$GLOBALS['phpgw']->acl =& Factory::getInstance('acl', $userID);
 		}
 
Index: sandbox/workflow/branches/609/inc/class.bo_userinterface.inc.php
===================================================================
--- sandbox/workflow/branches/609/inc/class.bo_userinterface.inc.php	(revision 2267)
+++ sandbox/workflow/branches/609/inc/class.bo_userinterface.inc.php	(revision 2291)
@@ -1070,5 +1070,5 @@
 	function callVoipConnect($params)
 	{
-		$cachedLDAP = $GLOBALS['workflow']['factory']->newInstance('CachedLDAP');
+		$cachedLDAP = Factory::newInstance('CachedLDAP');
 		$cachedLDAP->setOperationMode($cachedLDAP->OPERATION_MODE_LDAP);
 
