Artem Dekhtyar
Pavel Stepanets
https://connect.sensiolabs.com/club/symfonybro
5+ years in development
DDD
Software architect
PHP, Java, C#
Symfony, Yii2
Legacy projects migration
Trouble ticket system - GERP
Was migrated from this
To Symfony!
Requirements
DateTime
Redirect
Modal window
Complex forms
for bundles
Transition guard
for additional transition data
to wrap Comment object
for setup Workflow services from bundle configuration
\Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension::registerWorkflowConfiguration
for transitions guarding
Expression Language and
Workflow guard events
(solution)
by League of Extraordinary packages
http://tactician.thephpleague.com/
public function execute($command, callable $next)
{
//...
$result = $next($command);
//...
try {
$workflow = $this->registry->get($task, $workflowName);
$workflow->apply($task, $command->getTransition());
} catch (Exception $exception) {
throw new TaskException( /* ... */ );
}
}
SymfonyBro\TaskBundle\Form\TransitionType
Choices are enabled transitions of given subject extracted from Workflow component
(comment)
Gorserv/Gerp/TaskServiceBundle/Resources/config/workflow.yml
transitions:
delay:
from: new
to: delayed
guard: 'is_granted(["ROLE_DISPATCHER"])'
dispatch:
from: new
to: scheduled
guard: 'is_granted(["ROLE_DISPATCHER"])'
to_work:
from: scheduled
to: in_work
guard: 'is_granted(["ROLE_TECH"])'
builds roles from specified workflow transitions and inject them into containers roles hierarchy
workflow
cancel:
from: new
to: canceled
to_agreement:
from: new
to: wait_agreement
dispatch:
from: new
to: scheduled
security.role_hierarchy.roles
ROLE_SERVICE_TRANSITION_CANCEL:
ROLE_SERVICE_TRANSITION_TO_AGREEMENT:
ROLE_SERVICE_TRANSITION_DISPATCH:
https://gitlab.com/symfony-bro
https://goo.gl/d52JVV (workflow-extensions-bundle)
https://gorserv.com/
https://goo.gl/PcBcNk (slides)