Skip to content

Commit

Permalink
Stop running after a case has been made
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzondervan committed Feb 9, 2024
1 parent 7d51fc0 commit e0b6971
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/Service/ZaakService.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ public function zaakHandler(?array $data = [], ?array $configuration = [])

if (isset($data['caseId']) === true) {
$this->getZaak($configuration, $data['caseId']);
return $data;
}

isset($this->style) === true && $this->zaakTypeService->setStyle($this->style);
Expand All @@ -510,37 +511,15 @@ public function zaakHandler(?array $data = [], ?array $configuration = [])
isset($this->style) === true && $this->style->success("Fetched $caseCount cases");
$this->logger->info("Fetched $caseCount cases");

$createdZaakCount = 0;
$flushCount = 0;
foreach ($xxllncCases as $case) {
$event = new ActionEvent(
'commongateway.action.event',
['caseId' => $case['reference']],
'xxllnc.case.received'
);
$this->eventDispatcher->dispatch($event, 'commongateway.action.event');

// if ($this->syncCase($case) instanceof ObjectEntity === false) {
// isset($this->style) === true && $this->style->error("Could not sync a case");
// $this->logger->error("Could not sync a case");
//
// continue;
// }
//
// $createdZaakCount = ($createdZaakCount + 1);
// $flushCount = ($flushCount + 1);
//
// Flush every 20
// if ($flushCount == 20) {
// $this->entityManager->flush();
// $this->entityManager->flush();
// $flushCount = 0;
// }//end if
}//end foreach

isset($this->style) === true && $this->style->success("Created $createdZaakCount zaken from the $caseCount fetched cases");
$this->logger->info("Created $createdZaakCount zaken from the $caseCount fetched cases");

}//end zaakHandler()


Expand Down

0 comments on commit e0b6971

Please sign in to comment.