TransitionDefinition
TransitionDefinition entity - Define transiciones validas entre estados. Configuracion data-driven de la maquina de estados. Cada transicion conecta un fromState con un toState y puede requerir uno o mas gates.
TransitionDefinition::__construct()
public function __construct():TransitionDefinition::onPreUpdate()
public function onPreUpdate(): voidTransitionDefinition::getId()
public function getId(): intTransitionDefinition::getDomain()
public function getDomain(): stringTransitionDefinition::getCode()
public function getCode(): stringTransitionDefinition::getLabel()
public function getLabel(): ?stringTransitionDefinition::getRequiredRole()
public function getRequiredRole(): ?stringTransitionDefinition::isEnabled()
public function isEnabled(): boolTransitionDefinition::getMetadata()
public function getMetadata(): ?arrayTransitionDefinition::getCreatedAt()
public function getCreatedAt(): DateTimeTransitionDefinition::getUpdatedAt()
public function getUpdatedAt(): DateTimeTransitionDefinition::getFromState()
public function getFromState(): Milpa\Workflow\Entities\StateDefinitionTransitionDefinition::getToState()
public function getToState(): Milpa\Workflow\Entities\StateDefinitionTransitionDefinition::getGateDefinitions()
public function getGateDefinitions(): Doctrine\Common\Collections\CollectionTransitionDefinition::setDomain()
public function setDomain(string $domain): selfSets the domain this transition belongs to (e.g. "opportunity", "project").
Parameters
| Name | Type | Description |
|---|---|---|
| $domain | string |
TransitionDefinition::setCode()
public function setCode(string $code): selfSets the transition's unique code within its domain.
Parameters
| Name | Type | Description |
|---|---|---|
| $code | string |
TransitionDefinition::setLabel()
public function setLabel(?string $label): selfSets the transition's human-readable label.
Parameters
| Name | Type | Description |
|---|---|---|
| $label | ?string |
TransitionDefinition::setRequiredRole()
public function setRequiredRole(?string $requiredRole): selfSets the minimum role required to execute this transition.
Parameters
| Name | Type | Description |
|---|---|---|
| $requiredRole | ?string |
TransitionDefinition::setEnabled()
public function setEnabled(bool $enabled): selfSets whether this transition is enabled.
Parameters
| Name | Type | Description |
|---|---|---|
| $enabled | bool |
TransitionDefinition::setMetadata()
public function setMetadata(?array $metadata): selfSets additional metadata for the transition.
Parameters
| Name | Type | Description |
|---|---|---|
| $metadata | (array<string, mixed> | null) |
TransitionDefinition::setFromState()
public function setFromState(Milpa\Workflow\Entities\StateDefinition $fromState): selfSets the state this transition originates from.
Parameters
| Name | Type | Description |
|---|---|---|
| $fromState | Milpa\Workflow\Entities\StateDefinition |
TransitionDefinition::setToState()
public function setToState(Milpa\Workflow\Entities\StateDefinition $toState): selfSets the state this transition arrives at.
Parameters
| Name | Type | Description |
|---|---|---|
| $toState | Milpa\Workflow\Entities\StateDefinition |
TransitionDefinition::addGateDefinition()
public function addGateDefinition(Milpa\Workflow\Entities\GateDefinition $gateDefinition): selfAdds a gate that must pass before this transition is allowed.
Parameters
| Name | Type | Description |
|---|---|---|
| $gateDefinition | Milpa\Workflow\Entities\GateDefinition |
TransitionDefinition::removeGateDefinition()
public function removeGateDefinition(Milpa\Workflow\Entities\GateDefinition $gateDefinition): selfRemoves a gate from this transition's requirements.
Parameters
| Name | Type | Description |
|---|---|---|
| $gateDefinition | Milpa\Workflow\Entities\GateDefinition |
TransitionDefinition::hasGates()
public function hasGates(): boolChecks if this transition has any gates configured.
TransitionDefinition::toArray()
public function toArray(): arrayConverts the entity to an array for API responses.