Skip to content

Commit 2805702

Browse files
committed
[FrameworkBundle] [Workflow] Fixed initial place config
1 parent c3c84fe commit 2805702

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
281281
->end()
282282
->end()
283283
->end()
284+
->scalarNode('initial_place')->defaultNull()->end()
284285
->arrayNode('places')
285286
->isRequired()
286287
->requiresAtLeastOneElement()

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,19 @@ private function registerWorkflowConfiguration(array $workflows, ContainerBuilde
420420
}
421421

422422
// Create a Definition
423-
$definitionDefinition = new Definition(Workflow\Definition::class);
424-
$definitionDefinition->setPublic(false);
425-
$definitionDefinition->addArgument($workflow['places']);
426-
$definitionDefinition->addArgument($transitions);
427-
$definitionDefinition->addTag('workflow.definition', array(
428-
'name' => $name,
429-
'type' => $type,
430-
'marking_store' => isset($workflow['marking_store']['type']) ? $workflow['marking_store']['type'] : null,
431-
));
423+
$definitionDefinition = (new Definition(Workflow\Definition::class))
424+
->setPublic(false)
425+
->addArgument($workflow['places'])
426+
->addArgument($transitions)
427+
->addTag('workflow.definition', array(
428+
'name' => $name,
429+
'type' => $type,
430+
'marking_store' => isset($workflow['marking_store']['type']) ? $workflow['marking_store']['type'] : null,
431+
))
432+
;
433+
if (isset($workflow['initial_place'])) {
434+
$definitionDefinition->addArgument($workflow['initial_place']);
435+
}
432436

433437
// Create MarkingStore
434438
if (isset($workflow['marking_store']['type'])) {

0 commit comments

Comments
 (0)