Skip to content

a very rough (but functional) attempt at a database-driven workflow

License

Notifications You must be signed in to change notification settings

aratinau/symfony-workflow

Repository files navigation

Symfony Workflow

Getting Started

make up

Webmail

http://localhost:8025/

Workflow Home made

Entities

OrderTransition

Controller

$context = [
    'user' => $currentUser,
    'order_total' => $order->getAmount(),
];

if ($workflow->canTransition($entityWorkflow, $order->getCurrentState(), $targetPlace, $context)) {
    $workflow->applyTransition($entityWorkflow, $order, $targetPlace);
    $em->flush();
} else {
    return new JsonResponse([
        'error' => sprintf('Transition non autorisée de %s ➝ %s', $order->getState(), $targetPlace->getName()),
    ], 400);
}

Workflow deprecated

About

a very rough (but functional) attempt at a database-driven workflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published