10000 [Workflow] WIP Create MarkingHistoryStore to allow logging of an entity's states by ChangePlaces · Pull Request #28265 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Workflow] WIP Create MarkingHistoryStore to allow logging of an entity's states #28265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update FrameworkExtension.php
  • Loading branch information
ChangePlaces authored Aug 25, 2018
commit ff7c41a31c389cc459d41576cdfa47c77696d64f
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,18 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
$markingStoreDefinition = new Reference($workflow['marking_store']['service']);
}

// create Marking History Store for optionally logging state history
if (isset($workflow['marking_history_store']))
{
$historyProperty = $workflow['marking_history_store']['history_property'];
$memoProperty = $workflow['marking_history_store']['memo_property'];

$markingHistoryDefinition = new Definition(Workflow\MarkingHistoryStore::class);
$markingHistoryDefinition->setPublic(false);
$markingHistoryDefinition->addArgument($historyProperty);
$markingHistoryDefinition->addArgument($memoProperty);
}

// Create Workflow
$workflowId = sprintf('%s.%s', $type, $name);
$workflowDefinition = new ChildDefinition(sprintf('%s.abstract', $type));
Expand All @@ -580,6 +592,9 @@ private function registerWorkflowConfiguration(array $config, ContainerBuilder $
$workflowDefinition->replaceArgument(1, $markingStoreDefinition);
}
$workflowDefinition->replaceArgument(3, $name);
if (isset($markingHistoryDefinition)) {
$workflowDefinition->replaceArgument(4, $markingHistoryDefinition);
}

// Store to container
$container->setDefinition($workflowId, $workflowDefinition);
Expand Down
0