two questions about the source code of instance.php
i have read through the source code of instance.php and have two questions,
first since the workitem represent the completed activity, why not delete the completed activity in the table instance_activity at the function complete() and abort()? i have checked the structure of table galaxia_workitem and galaxia_instance_activities, the latter one is duplicated information of the former one except the "property" field, why not deleted the completed activities? it cost more space
and in the in the instance.php, sendTo() function, what is the meaning of these codes:
$query="delete from `".GALAXIA_TABLE_PREFIX."instance_activities` where `instanceId`=? and `activityId`=?";
$this->query($query,arrayint)$iid,(int)$activityId;
$query="insert into `".GALAXIA_TABLE_PREFIX."instance_activities`(`instanceId`,`activityId`,`user`,`status`,`started`) values(?,?,?,?,?)";
$this->query($query,arrayint)$iid,(int)$activityId,$putuser,'running',(int)$now;
the delete query seems to delete the record will be inserted, so it will has nothing to do. any two instance, even of same process will have different iid, so what the meaning of the delete query?
any help will be highly appreciated!