Merged
Conversation
…he container scope
…er.operation_runner`
dc14531 to
31577ff
Compare
iteman
added a commit
that referenced
this pull request
Sep 1, 2016
This PR was merged into the 1.2-dev branch.
Discussion
----------
Service Task support
| Q | A
| ------------- | ---
| Branch? | `master`
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | -
| Fixed tickets | -
| License | BSD-2-Clause
This PR adds the Service Task support.
When a Service Task is reached in the process, the task will be allocated and started automatically, and the associated Symfony service is executed at the `started` state on the work item. And the task will be completed automatically.
Symfony services for this must implement `PHPMentors\Workflower\Workflow\Operation\OperationRunnerInterface` as the following:
```php
<?php
...
use PHPMentors\Workflower\Workflow\Operation\OperationalInterface;
use PHPMentors\Workflower\Workflow\Operation\OperationRunnerInterface;
use PHPMentors\Workflower\Workflow\Workflow;
use PHPMentors\WorkflowerBundle\Workflow\Participant\SecurityParticipant;
use PHPMentors\WorkflowerBundle\Workflow\Participant\SecurityParticipantAwareInterface;
class ...OperationRunner implements OperationRunnerInterface, SecurityParticipantAwareInterface
{
private $securityParticipant;
public function setSecurityParticipant(SecurityParticipant $participant)
{
$this->securityParticipant = $participant;
}
public function provideParticipant(OperationalInterface $operational, Workflow $workflow)
{
return $this->securityParticipant;
}
public function run(OperationalInterface $operational, Workflow $workflow)
{
...
}
}
```
And the Symfony service for an operation runner should be tagged as `phpmentors_workflower.operation_runner` with `phpmentors_workflower.security_participant_aware` as the following:
```yaml
..._operation_runner:
...
tags:
- { name: phpmentors_workflower.operation_runner }
- { name: phpmentors_workflower.security_participant_aware }
```
Commits
-------
441f3f9 change the scope of `phpmentors_workflower.security_participant` to the container scope
31577ff add support for Service Tasks by the service tag `phpmentors_workflower.operation_runner`
iteman
added a commit
that referenced
this pull request
Sep 2, 2016
…y instead of the `OperationRunnerInterface` collection #8
iteman
added a commit
that referenced
this pull request
Sep 2, 2016
… the tag 'phpmentors_workflower.security_participant_aware' #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
masterThis PR adds the Service Task support.
When a Service Task is reached in the process, the task will be allocated and started automatically, and the associated Symfony service is executed at the
startedstate on the work item. And the task will be completed automatically.Symfony services for this must implement
PHPMentors\Workflower\Workflow\Operation\OperationRunnerInterfaceas the following:And the Symfony service for an operation runner should be tagged as
phpmentors_workflower.operation_runnerwithphpmentors_workflower.security_participant_awareas the following: