/** * @param ItemTreeBounds $itemTreeBounds * @param int $userId */ protected function processClearingEventsForItem(ItemTreeBounds $itemTreeBounds, $userId, $groupId, $additionalEventsFromThisJob) { $this->dbManager->begin(); $itemId = $itemTreeBounds->getItemId(); switch ($this->conflictStrategyId) { case self::FORCE_DECISION: $createDecision = true; break; default: $createDecision = !$this->clearingDecisionProcessor->hasUnhandledScannerDetectedLicenses($itemTreeBounds, $groupId, $additionalEventsFromThisJob, $this->licenseMap); } if ($createDecision) { $this->clearingDecisionProcessor->makeDecisionFromLastEvents($itemTreeBounds, $userId, $groupId, DecisionTypes::IDENTIFIED, $this->decisionIsGlobal, $additionalEventsFromThisJob); } else { foreach ($additionalEventsFromThisJob as $eventId) { $this->clearingDao->copyEventIdTo($eventId, $itemId, $userId, $groupId); } $this->clearingDao->markDecisionAsWip($itemId, $userId, $groupId); } $this->heartbeat(1); $this->dbManager->commit(); }