mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
record single task states transition and add them in timeline
This commit is contained in:
@@ -32,6 +32,8 @@ class ChillTaskExtension extends Extension implements PrependExtensionInterface
|
||||
$loader->load('services/workflow.yml');
|
||||
$loader->load('services/templating.yml');
|
||||
$loader->load('services/menu.yml');
|
||||
$loader->load('services/event.yml');
|
||||
$loader->load('services/timeline.yml');
|
||||
}
|
||||
|
||||
public function prepend(ContainerBuilder $container)
|
||||
|
@@ -22,6 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Chill\TaskBundle\Workflow\TaskWorkflowManager;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
use Chill\TaskBundle\Templating\UI\CountNotificationTask;
|
||||
use Chill\TaskBundle\Event\Lifecycle\TaskLifecycleEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -39,6 +40,7 @@ class TaskWorkflowDefinitionCompilerPass implements CompilerPassInterface
|
||||
|
||||
$workflowManagerDefinition = $container->getDefinition(TaskWorkflowManager::class);
|
||||
$counterDefinition = $container->getDefinition(CountNotificationTask::class);
|
||||
$lifecycleDefinition = $container->getDefinition(TaskLifecycleEvent::class);
|
||||
|
||||
foreach ($container->findTaggedServiceIds('chill_task.workflow_definition') as $id => $tags) {
|
||||
// registering the definition to manager
|
||||
@@ -58,6 +60,12 @@ class TaskWorkflowDefinitionCompilerPass implements CompilerPassInterface
|
||||
'method' => 'resetCacheOnNewStates',
|
||||
'priority' => 0
|
||||
]);
|
||||
$lifecycleDefinition
|
||||
->addTag('kernel.event_listener', [
|
||||
'event' => sprintf('workflow.%s.transition', $definition->getClass()::getAssociatedWorkflowName()),
|
||||
'method' => 'onTransition',
|
||||
'priority' => 0
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user