Changeset 3060 for sandbox/workflow/trunk/inc/engine/src
- Timestamp:
- 07/15/10 17:30:07 (14 years ago)
- Location:
- sandbox/workflow/trunk/inc/engine/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/trunk/inc/engine/src/API/BaseActivity.php
r2372 r3060 84 84 * Seems to be the rest of a bad object architecture 85 85 * 86 * @deprecated 86 * @deprecated 2.2.00.000 87 87 */ 88 88 function setDb(&$db) 89 89 { 90 wf_warn_deprecated_method(); 90 91 $this->db =& $db; 91 92 } … … 550 551 * e.g. $isadmin = $activity->checkUserRole($user,'admin') 551 552 * 552 * @deprecated Unused function. Old API, do not use it. Return always false553 * @deprecated 2.2.00.000 - Unused function. Old API, do not use it. Return always false 553 554 */ 554 555 function checkUserRole($user,$rolename) 555 556 { 557 wf_warn_deprecated_method(); 556 558 $this->error[] = 'use of an old deprecated function checkUserRole, return always false'; 557 559 return false; -
sandbox/workflow/trunk/inc/engine/src/API/Instance.php
r2886 r3060 84 84 */ 85 85 var $parentLock = false; 86 /**87 * @var int $parentActivityId The activity ID of the parent instance88 * @access public89 */90 var $parentActivityId;91 86 /** 92 87 * @var int $parentInstanceId The instance ID of the parent instance … … 490 485 return ''; 491 486 } 492 487 493 488 /** 494 489 * Creates a new instance. … … 503 498 function _createNewInstance($activityId,$user) { 504 499 // Creates a new instance setting up started, ended, user, status and owner 505 $pid = $this->getOne(' select wf_p_id from '.GALAXIA_TABLE_PREFIX.'activities wherewf_activity_id=?',array((int)$activityId));500 $pid = $this->getOne('SELECT wf_p_id FROM '.GALAXIA_TABLE_PREFIX.'activities WHERE wf_activity_id=?',array((int)$activityId)); 506 501 $this->pId = $pid; 507 502 $this->setStatus('active'); … … 515 510 $iid=$this->instanceId; 516 511 517 $query = 'insert into '.GALAXIA_TABLE_PREFIX.'instances 518 (wf_instance_id, wf_started,wf_ended,wf_status,wf_p_id,wf_owner,wf_properties) 519 values(?,?,?,?,?,?,?)'; 520 521 $this->query($query,array((int)$iid, $now,0,'active',$pid,$user,$this->security_cleanup(Array(),false))); 522 512 $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'instances 513 (wf_instance_id, wf_started,wf_ended,wf_status,wf_p_id,wf_owner,wf_properties) 514 VALUES 515 (?,?,?,?,?,?,?)'; 516 517 $this->query($query,array((int)$iid, $now,0,'active',$pid,$user,$this->security_cleanup(Array(),false))); 518 523 519 // Then add in ".GALAXIA_TABLE_PREFIX."instance_activities an entry for the 524 520 // activity the user and status running and started now 525 $query = 'insert into '.GALAXIA_TABLE_PREFIX.'instance_activities (wf_instance_id,wf_activity_id,wf_user, 526 wf_started,wf_status) values(?,?,?,?,?)'; 521 $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'instance_activities 522 (wf_instance_id,wf_activity_id,wf_user,wf_started,wf_status) 523 VALUES 524 (?,?,?,?,?)'; 527 525 $this->query($query,array((int)$iid,(int)$activityId,$user,(int)$now,'running')); 528 526 529 527 if (($this->isChildInstance) && (!is_null($this->parentInstanceId))) 530 528 { 531 $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'interinstance_relations(wf_parent_instance_id, wf_parent_activity_id, wf_child_instance_id, wf_parent_lock) VALUES(?,?,?,?)'; 532 $this->query($query,array((int) $this->parentInstanceId, (int) $this->parentActivityId, (int) $iid, (int) (($this->parentLock) ? 1 : 0))); 533 } 534 529 $query = 'INSERT INTO '.GALAXIA_TABLE_PREFIX.'interinstance_relations 530 (wf_parent_instance_id, wf_child_instance_id, wf_parent_lock) 531 VALUES 532 (?,?,?)'; 533 $this->query($query,array((int) $this->parentInstanceId, (int) $iid, (int) (($this->parentLock) ? 1 : 0))); 534 } 535 535 536 //update database with other datas stored in the object 536 537 return $this->sync(); 537 538 } 538 539 539 540 /** 540 541 * Sets the name of this instance … … 1142 1143 return $this->__activity_completed; 1143 1144 } 1144 1145 1145 1146 /** 1146 1147 * This function can be called by the instance object himself (for automatic activities) 1147 * or by the WfRuntime object. In interactive activities code users use complete() --without args-- 1148 * which refer to the WfRuntime->complete() function which call this one. 1148 * or by the WfRuntime object. In interactive activities code users use complete() --without args-- 1149 * which refer to the WfRuntime->complete() function which call this one. 1149 1150 * In non-interactive activities a call to a complete() will generate errors because the engine 1150 1151 * does it his own way as I said first. … … 1162 1163 { 1163 1164 //$this->db-> 1164 $result = $this->query("SELECT 1 FROM " . GALAXIA_TABLE_PREFIX . "instances i, " . GALAXIA_TABLE_PREFIX . "interinstance_relations ir WHERE (ir.wf_child_instance_id = i.wf_instance_id) AND (i.wf_status IN ('active', 'exception')) AND (ir.wf_parent_lock = 1) AND (ir.wf_parent_instance_id = ?) AND (ir.wf_parent_activity_id = ?)", array($this->instanceId, $activityId));1165 $result = $this->query("SELECT 1 FROM " . GALAXIA_TABLE_PREFIX . "instances i, " . GALAXIA_TABLE_PREFIX . "interinstance_relations ir WHERE (ir.wf_child_instance_id = i.wf_instance_id) AND (i.wf_status IN ('active', 'exception')) AND (ir.wf_parent_lock = 1) AND (ir.wf_parent_instance_id = ?)", array($this->instanceId)); 1165 1166 if ($result->numRows() > 0) 1166 1167 die("Esta instância está aguardando que outras instâncias, das quais depende, sejam finalizadas."); … … 1170 1171 //The complete() is in a transaction, it will be completly done or not at all 1171 1172 $this->db->StartTrans(); 1172 1173 1173 1174 //lock rows and ensure access is granted 1174 1175 if (!(isset($this->security))) $this->security = &Factory::getInstance('WfSecurity'); -
sandbox/workflow/trunk/inc/engine/src/ProcessMonitor/ProcessMonitor.php
r2372 r3060 59 59 60 60 /** 61 * @deprecated 61 * @deprecated 2.2.00.000 62 62 */ 63 63 function update_instance_status($iid,$status) { 64 wf_warn_deprecated_method(); 64 65 return; 65 66 $query = "update `".GALAXIA_TABLE_PREFIX."instances` set `wf_status`=? where `wf_instance_id`=?"; … … 69 70 70 71 /** 71 * @deprecated 72 * @deprecated 2.2.00.000 72 73 */ 73 74 function update_instance_activity_status($iid,$activityId,$status) { 75 wf_warn_deprecated_method(); 74 76 return; 75 77 $query = "update `".GALAXIA_TABLE_PREFIX."instance_activities` set `wf_status`=? where `wf_instance_id`=? and `wf_activity_id`=?"; -
sandbox/workflow/trunk/inc/engine/src/common/WfRuntime.php
r2858 r3060 1089 1089 $run_activity = Factory::newInstance('run_activity'); 1090 1090 $run_activity->runtime->instance->parentInstanceId = $this->instance_id; 1091 $run_activity->runtime->instance->parentActivityId = $this->activity_id;1092 1091 $output = $run_activity->goChildInstance($activityID, $properties, $user, $parentLock); 1093 1092 $_REQUEST['iid'] = $iid; … … 1128 1127 function getParent() 1129 1128 { 1130 $resultSet = $this->query("SELECT wf_parent_instance_id, wf_parent_ activity_id, wf_parent_lock FROM egw_wf_interinstance_relations WHERE (wf_child_instance_id = ?)", array($this->getInstanceId()));1129 $resultSet = $this->query("SELECT wf_parent_instance_id, wf_parent_lock FROM egw_wf_interinstance_relations WHERE (wf_child_instance_id = ?)", array($this->getInstanceId())); 1131 1130 if (($row = $resultSet->fetchRow())) 1132 return array('instance_id' => $row['wf_parent_instance_id'], ' activity_id' => $row['wf_parent_activity_id'], 'lock' => ($row['wf_parent_lock'] == 1));1131 return array('instance_id' => $row['wf_parent_instance_id'], 'lock' => ($row['wf_parent_lock'] == 1)); 1133 1132 else 1134 1133 return false;
Note: See TracChangeset
for help on using the changeset viewer.