CaseActivities/CaseAutomation sind Fassaden über ProcessRunner. Verhaltensvergleich v0.11: 11 Abläufe und 198 Konstellationen gleich, beabsichtigte Abweichungen I-004/I-005 (F-001/F-002). Volle Suite vor U-B: 785/785. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
58 lines
1.3 KiB
PHP
58 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Process\Models;
|
|
|
|
/**
|
|
* An admissible variant of a model: further modules at its extension points, the same case type. A variant marked
|
|
* tester-only can be configured as a draft and played through in the process tester, never frozen into a real case.
|
|
*/
|
|
final class Variant
|
|
{
|
|
/** @var array<string, list<string>> point value => module keys */
|
|
private array $inserts = [];
|
|
|
|
private bool $testerOnly = false;
|
|
|
|
private function __construct(public readonly string $key, public readonly string $label) {}
|
|
|
|
public static function make(string $key, string $label): self
|
|
{
|
|
return new self($key, $label);
|
|
}
|
|
|
|
public function insert(Point $point, string $module): self
|
|
{
|
|
$this->inserts[$point->value][] = $module;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function testerOnly(): self
|
|
{
|
|
$this->testerOnly = true;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function isTesterOnly(): bool
|
|
{
|
|
return $this->testerOnly;
|
|
}
|
|
|
|
/**
|
|
* @return list<string>
|
|
*/
|
|
public function modulesAt(Point $point): array
|
|
{
|
|
return $this->inserts[$point->value] ?? [];
|
|
}
|
|
|
|
/**
|
|
* @return array<string, list<string>>
|
|
*/
|
|
public function inserts(): array
|
|
{
|
|
return $this->inserts;
|
|
}
|
|
}
|