{"action":"created","comment":{"url":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/comments/88474199","pull_request_review_id":9046456,"id":88474199,"diff_hunk":"@@ -0,0 +1,85 @@\n+<?php\n+namespace Neos\\Cqrs\\ProcessManager;\n+\n+/*\n+ * This file is part of the Neos.EventStore package.\n+ *\n+ * (c) Contributors of the Neos Project - www.neos.io\n+ *\n+ * This package is Open Source Software. For the full copyright and license\n+ * information, please view the LICENSE file which was distributed with this\n+ * source code.\n+ */\n+use Neos\\Cqrs\\Event\\EventInterface;\n+use Neos\\Cqrs\\EventListener\\EventListenerInterface;\n+use Neos\\Cqrs\\EventListener\\ActsBeforeInvokingEventListenerMethodsInterface;\n+use Neos\\Cqrs\\EventStore\\RawEvent;\n+use Neos\\Cqrs\\ProcessManager\\State\\State;\n+use Neos\\Cqrs\\ProcessManager\\State\\StateRepository;\n+use TYPO3\\Flow\\Annotations as Flow;\n+\n+/**\n+ * Base implementation for a process manager\n+ */\n+abstract class AbstractProcessManager implements EventListenerInterface, ActsBeforeInvokingEventListenerMethodsInterface\n+{\n+    /**\n+     * @Flow\\Inject\n+     * @var StateRepository\n+     */\n+    protected $stateRepository;\n+\n+    /**\n+     * @var State\n+     */\n+    protected $state;\n+\n+    /**\n+     * Return the process configuration for the concrete process manager\n+     *\n+     * This method must return an array which contains (short) event names and a correlating closure which\n+     * returns a process state identifier. This process state identifier will be used throughout all event listener\n+     * methods in the process manager to always retrieve the correct state.\n+     *\n+     * The \"short event name\" is the same used in the \"when<ShortName>()\" method name of the event listener method.\n+     *\n+     * The following example uses the organization's identifier as the process state identifier:\n+     *\n+     *     return [\n+     *         'OrganizationHasBeenCreated' => function(OrganizationHasBeenCreated $event) {\n+     *             return $event->getIdentifier();\n+     *         },\n+     *         'MemberHasBeenAddedToOrganization' => function(MemberHasBeenAddedToOrganization $event) {\n+     *             return $event->getOrganizationIdentifier();\n+     *         },\n+     *         'NewDeploymentKeyHasBeenGenerated' => function(NewDeploymentKeyHasBeenGenerated $event) {\n+     *             return $event->getOrganizationIdentifier();\n+     *         }\n+     *\n+     * @return array\n+     */\n+    abstract protected function getProcessConfiguration(): array;\n+\n+    /**\n+     * Prepare the process state\n+     *\n+     * @param string $eventListenerMethodName\n+     * @param EventInterface $event\n+     * @param RawEvent $rawEvent\n+     * @throws ProcessManagerException\n+     */\n+    public function beforeInvokingEventListenerMethod(string $eventListenerMethodName, EventInterface $event, RawEvent $rawEvent)\n+    {\n+        $configuration = $this->getProcessConfiguration();\n+        $eventName = substr($eventListenerMethodName, 4);","path":"Classes/ProcessManager/AbstractProcessManager.php","position":74,"original_position":74,"commit_id":"0975b766963f10cfc8cc83453b7cdea7ce4a3981","original_commit_id":"84076a524448e5e17ed2f18f78d5e1341ee534c9","user":{"login":"bwaidelich","id":307571,"avatar_url":"https://avatars.githubusercontent.com/u/307571?v=3","gravatar_id":"","url":"https://api.github.com/users/bwaidelich","html_url":"https://github.com/bwaidelich","followers_url":"https://api.github.com/users/bwaidelich/followers","following_url":"https://api.github.com/users/bwaidelich/following{/other_user}","gists_url":"https://api.github.com/users/bwaidelich/gists{/gist_id}","starred_url":"https://api.github.com/users/bwaidelich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bwaidelich/subscriptions","organizations_url":"https://api.github.com/users/bwaidelich/orgs","repos_url":"https://api.github.com/users/bwaidelich/repos","events_url":"https://api.github.com/users/bwaidelich/events{/privacy}","received_events_url":"https://api.github.com/users/bwaidelich/received_events","type":"User","site_admin":false},"body":"I would say: Use `$rawEvent->getType()` as configuration identifier, no need to repeat anything then","created_at":"2016-11-17T15:24:07Z","updated_at":"2016-11-17T15:24:07Z","html_url":"https://github.com/neos/Neos.Cqrs/pull/113#discussion_r88474199","pull_request_url":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/comments/88474199"},"html":{"href":"https://github.com/neos/Neos.Cqrs/pull/113#discussion_r88474199"},"pull_request":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113","id":93949305,"html_url":"https://github.com/neos/Neos.Cqrs/pull/113","diff_url":"https://github.com/neos/Neos.Cqrs/pull/113.diff","patch_url":"https://github.com/neos/Neos.Cqrs/pull/113.patch","issue_url":"https://api.github.com/repos/neos/Neos.Cqrs/issues/113","number":113,"state":"open","locked":false,"title":"FEATURE: Basic process manager ","user":{"login":"robertlemke","id":95582,"avatar_url":"https://avatars.githubusercontent.com/u/95582?v=3","gravatar_id":"","url":"https://api.github.com/users/robertlemke","html_url":"https://github.com/robertlemke","followers_url":"https://api.github.com/users/robertlemke/followers","following_url":"https://api.github.com/users/robertlemke/following{/other_user}","gists_url":"https://api.github.com/users/robertlemke/gists{/gist_id}","starred_url":"https://api.github.com/users/robertlemke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertlemke/subscriptions","organizations_url":"https://api.github.com/users/robertlemke/orgs","repos_url":"https://api.github.com/users/robertlemke/repos","events_url":"https://api.github.com/users/robertlemke/events{/privacy}","received_events_url":"https://api.github.com/users/robertlemke/received_events","type":"User","site_admin":false},"body":"This change introduce a basic process manager which can keep\r\na state containing further information about the process at hand.\r\n\r\nIn order to make the process manager more convenient, this change\r\nalso  introduces a new interface which allows for custom handling\r\nof event listener method invocations.\r\n\r\nThose event listeners implementing this interface gain control\r\nover the actual event listener method call and are able to\r\ntake additional steps to prepare for handling the event.","created_at":"2016-11-16T11:36:25Z","updated_at":"2016-11-17T15:24:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cd4fc4db2cb28ddf987f98267de331a47c34c7e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113/commits","review_comments_url":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113/comments","review_comment_url":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neos/Neos.Cqrs/issues/113/comments","statuses_url":"https://api.github.com/repos/neos/Neos.Cqrs/statuses/0975b766963f10cfc8cc83453b7cdea7ce4a3981","head":{"label":"robertlemke:feature/processmanager","ref":"feature/processmanager","sha":"0975b766963f10cfc8cc83453b7cdea7ce4a3981","user":{"login":"robertlemke","id":95582,"avatar_url":"https://avatars.githubusercontent.com/u/95582?v=3","gravatar_id":"","url":"https://api.github.com/users/robertlemke","html_url":"https://github.com/robertlemke","followers_url":"https://api.github.com/users/robertlemke/followers","following_url":"https://api.github.com/users/robertlemke/following{/other_user}","gists_url":"https://api.github.com/users/robertlemke/gists{/gist_id}","starred_url":"https://api.github.com/users/robertlemke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertlemke/subscriptions","organizations_url":"https://api.github.com/users/robertlemke/orgs","repos_url":"https://api.github.com/users/robertlemke/repos","events_url":"https://api.github.com/users/robertlemke/events{/privacy}","received_events_url":"https://api.github.com/users/robertlemke/received_events","type":"User","site_admin":false},"repo":{"id":67508306,"name":"Neos.Cqrs","full_name":"robertlemke/Neos.Cqrs","owner":{"login":"robertlemke","id":95582,"avatar_url":"https://avatars.githubusercontent.com/u/95582?v=3","gravatar_id":"","url":"https://api.github.com/users/robertlemke","html_url":"https://github.com/robertlemke","followers_url":"https://api.github.com/users/robertlemke/followers","following_url":"https://api.github.com/users/robertlemke/following{/other_user}","gists_url":"https://api.github.com/users/robertlemke/gists{/gist_id}","starred_url":"https://api.github.com/users/robertlemke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertlemke/subscriptions","organizations_url":"https://api.github.com/users/robertlemke/orgs","repos_url":"https://api.github.com/users/robertlemke/repos","events_url":"https://api.github.com/users/robertlemke/events{/privacy}","received_events_url":"https://api.github.com/users/robertlemke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/robertlemke/Neos.Cqrs","description":null,"fork":true,"url":"https://api.github.com/repos/robertlemke/Neos.Cqrs","forks_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/forks","keys_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/teams","hooks_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/hooks","issue_events_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/issues/events{/number}","events_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/events","assignees_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/assignees{/user}","branches_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/branches{/branch}","tags_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/tags","blobs_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/git/refs{/sha}","trees_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/statuses/{sha}","languages_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/languages","stargazers_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/stargazers","contributors_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/contributors","subscribers_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/subscribers","subscription_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/subscription","commits_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/commits{/sha}","git_commits_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/git/commits{/sha}","comments_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/comments{/number}","issue_comment_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/issues/comments{/number}","contents_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/contents/{+path}","compare_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/merges","archive_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/downloads","issues_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/issues{/number}","pulls_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/pulls{/number}","milestones_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/milestones{/number}","notifications_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/labels{/name}","releases_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/releases{/id}","deployments_url":"https://api.github.com/repos/robertlemke/Neos.Cqrs/deployments","created_at":"2016-09-06T12:57:53Z","updated_at":"2016-09-06T12:57:54Z","pushed_at":"2016-11-17T14:15:10Z","git_url":"git://github.com/robertlemke/Neos.Cqrs.git","ssh_url":"git@github.com:robertlemke/Neos.Cqrs.git","clone_url":"https://github.com/robertlemke/Neos.Cqrs.git","svn_url":"https://github.com/robertlemke/Neos.Cqrs","homepage":null,"size":406,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"neos:master","ref":"master","sha":"8c491a203e279a3f2fba7d9041163d21af57f17d","user":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"repo":{"id":67050550,"name":"Neos.Cqrs","full_name":"neos/Neos.Cqrs","owner":{"login":"neos","id":11575267,"avatar_url":"https://avatars.githubusercontent.com/u/11575267?v=3","gravatar_id":"","url":"https://api.github.com/users/neos","html_url":"https://github.com/neos","followers_url":"https://api.github.com/users/neos/followers","following_url":"https://api.github.com/users/neos/following{/other_user}","gists_url":"https://api.github.com/users/neos/gists{/gist_id}","starred_url":"https://api.github.com/users/neos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neos/subscriptions","organizations_url":"https://api.github.com/users/neos/orgs","repos_url":"https://api.github.com/users/neos/repos","events_url":"https://api.github.com/users/neos/events{/privacy}","received_events_url":"https://api.github.com/users/neos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neos/Neos.Cqrs","description":null,"fork":false,"url":"https://api.github.com/repos/neos/Neos.Cqrs","forks_url":"https://api.github.com/repos/neos/Neos.Cqrs/forks","keys_url":"https://api.github.com/repos/neos/Neos.Cqrs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neos/Neos.Cqrs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neos/Neos.Cqrs/teams","hooks_url":"https://api.github.com/repos/neos/Neos.Cqrs/hooks","issue_events_url":"https://api.github.com/repos/neos/Neos.Cqrs/issues/events{/number}","events_url":"https://api.github.com/repos/neos/Neos.Cqrs/events","assignees_url":"https://api.github.com/repos/neos/Neos.Cqrs/assignees{/user}","branches_url":"https://api.github.com/repos/neos/Neos.Cqrs/branches{/branch}","tags_url":"https://api.github.com/repos/neos/Neos.Cqrs/tags","blobs_url":"https://api.github.com/repos/neos/Neos.Cqrs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neos/Neos.Cqrs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neos/Neos.Cqrs/git/refs{/sha}","trees_url":"https://api.github.com/repos/neos/Neos.Cqrs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neos/Neos.Cqrs/statuses/{sha}","languages_url":"https://api.github.com/repos/neos/Neos.Cqrs/languages","stargazers_url":"https://api.github.com/repos/neos/Neos.Cqrs/stargazers","contributors_url":"https://api.github.com/repos/neos/Neos.Cqrs/contributors","subscribers_url":"https://api.github.com/repos/neos/Neos.Cqrs/subscribers","subscription_url":"https://api.github.com/repos/neos/Neos.Cqrs/subscription","commits_url":"https://api.github.com/repos/neos/Neos.Cqrs/commits{/sha}","git_commits_url":"https://api.github.com/repos/neos/Neos.Cqrs/git/commits{/sha}","comments_url":"https://api.github.com/repos/neos/Neos.Cqrs/comments{/number}","issue_comment_url":"https://api.github.com/repos/neos/Neos.Cqrs/issues/comments{/number}","contents_url":"https://api.github.com/repos/neos/Neos.Cqrs/contents/{+path}","compare_url":"https://api.github.com/repos/neos/Neos.Cqrs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neos/Neos.Cqrs/merges","archive_url":"https://api.github.com/repos/neos/Neos.Cqrs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neos/Neos.Cqrs/downloads","issues_url":"https://api.github.com/repos/neos/Neos.Cqrs/issues{/number}","pulls_url":"https://api.github.com/repos/neos/Neos.Cqrs/pulls{/number}","milestones_url":"https://api.github.com/repos/neos/Neos.Cqrs/milestones{/number}","notifications_url":"https://api.github.com/repos/neos/Neos.Cqrs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neos/Neos.Cqrs/labels{/name}","releases_url":"https://api.github.com/repos/neos/Neos.Cqrs/releases{/id}","deployments_url":"https://api.github.com/repos/neos/Neos.Cqrs/deployments","created_at":"2016-08-31T15:33:57Z","updated_at":"2016-10-26T11:48:29Z","pushed_at":"2016-11-17T14:15:11Z","git_url":"git://github.com/neos/Neos.Cqrs.git","ssh_url":"git@github.com:neos/Neos.Cqrs.git","clone_url":"https://github.com/neos/Neos.Cqrs.git","svn_url":"https://github.com/neos/Neos.Cqrs","homepage":null,"size":447,"stargazers_count":4,"watchers_count":4,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":18,"forks":8,"open_issues":18,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113"},"html":{"href":"https://github.com/neos/Neos.Cqrs/pull/113"},"issue":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/issues/113"},"comments":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/neos/Neos.Cqrs/statuses/0975b766963f10cfc8cc83453b7cdea7ce4a3981"}}}}
{"actor":{"display_login":"bwaidelich"}}