'Unauthorized']); exit; } $person_id = $_GET['person_id'] ?? null; $process_definition_id = $_GET['process_id'] ?? null; if (!$person_id || !$process_definition_id) { http_response_code(400); echo json_encode(['error' => 'Missing person_id or process_id']); exit; } $userId = $_SESSION['user_id']; $engine = new WorkflowEngine(); $pdo = db(); // Fetch Person and Process Definition details first $stmt_person = $pdo->prepare("SELECT first_name, last_name FROM people WHERE id = ?"); $stmt_person->execute([$person_id]); $person = $stmt_person->fetch(); $stmt_process = $pdo->prepare("SELECT * FROM process_definitions WHERE id = ?"); $stmt_process->execute([$process_definition_id]); $process = $stmt_process->fetch(); if (!$person || !$process) { http_response_code(404); echo "
Could not find person or process.
"; exit; } // Try to find an existing instance $instance = $engine->getInstanceByDefId($person_id, $process_definition_id); ?>No actions available.
Brak zdarzeń.
This process has not been started for this person.
This person is not eligible to start this process.