{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/63568156","id":63568156,"diff_hunk":"@@ -310,4 +342,17 @@ final case class WorkflowExecutionActor(workflowId: WorkflowId, workflowDescript\n         Success(WorkflowExecutionDiff(Map(collector -> ExecutionStatus.Starting)))\n     }\n   }\n+\n+  private def pushOutputsToMetadataService(data: WorkflowExecutionActorData): Future[Unit] = {\n+    import workflow._\n+    val keyValues = data.outputStore.store.flatMap {\n+      case (key, value) => value map (entry => s\"${key.call.fullyQualifiedName}.${entry.name}\" -> entry.wdlValue.map(_.toWdlString).getOrElse(\"NA\"))\n+    }\n+    val metadataEventMsgs = keyValues map{ case (k,v) => MetadataEvent(MetadataKey(workflowId, None, s\"${WorkflowMetadataKeys.Outputs}.$k\"), MetadataValue(v))}","path":"engine/src/main/scala/cromwell/engine/workflow/lifecycle/execution/WorkflowExecutionActor.scala","position":115,"original_position":115,"commit_id":"78719e37877eb13f0c89f0d0365366c9238c4e9a","original_commit_id":"78719e37877eb13f0c89f0d0365366c9238c4e9a","user":{"login":"gauravs90","id":13227423,"avatar_url":"https://avatars.githubusercontent.com/u/13227423?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravs90","html_url":"https://github.com/gauravs90","followers_url":"https://api.github.com/users/gauravs90/followers","following_url":"https://api.github.com/users/gauravs90/following{/other_user}","gists_url":"https://api.github.com/users/gauravs90/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravs90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravs90/subscriptions","organizations_url":"https://api.github.com/users/gauravs90/orgs","repos_url":"https://api.github.com/users/gauravs90/repos","events_url":"https://api.github.com/users/gauravs90/events{/privacy}","received_events_url":"https://api.github.com/users/gauravs90/received_events","type":"User","site_admin":false},"body":"`:` or `$` or `#` anybody has any opinions? ","created_at":"2016-05-17T17:36:53Z","updated_at":"2016-05-17T17:36:53Z","html_url":"https://github.com/broadinstitute/cromwell/pull/829#discussion_r63568156","pull_request_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments/63568156"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/829#discussion_r63568156"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829","id":69912276,"html_url":"https://github.com/broadinstitute/cromwell/pull/829","diff_url":"https://github.com/broadinstitute/cromwell/pull/829.diff","patch_url":"https://github.com/broadinstitute/cromwell/pull/829.patch","issue_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/829","number":829,"state":"open","locked":false,"title":"Engine pushes to the MetadataService closes #668","user":{"login":"gauravs90","id":13227423,"avatar_url":"https://avatars.githubusercontent.com/u/13227423?v=3","gravatar_id":"","url":"https://api.github.com/users/gauravs90","html_url":"https://github.com/gauravs90","followers_url":"https://api.github.com/users/gauravs90/followers","following_url":"https://api.github.com/users/gauravs90/following{/other_user}","gists_url":"https://api.github.com/users/gauravs90/gists{/gist_id}","starred_url":"https://api.github.com/users/gauravs90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gauravs90/subscriptions","organizations_url":"https://api.github.com/users/gauravs90/orgs","repos_url":"https://api.github.com/users/gauravs90/repos","events_url":"https://api.github.com/users/gauravs90/events{/privacy}","received_events_url":"https://api.github.com/users/gauravs90/received_events","type":"User","site_admin":false},"body":"Okay. So initially, I was passing the `ServiceRegistryActor` reference via props down the chain of actors, and each of the actors needed to follow a pattern of steps to insert into the metadata (e.g. create a `MetadataEvent` with a `MetadataPutAction` within which the `Metadata[Key, Value]` resided, send this message over to the the service registry, and handle failures, if any. It did not look good by any stretch IMO. All the metadata generating entities needed to be aware of the `MetadataService` (the erstwhile dataAcess)\r\n\r\n**Edit:** Using the above design in-fact now.\r\n\r\n~~Currently, what I've done below is create a single instance of the `ServiceRegistryActor` in the `WorkflowManagerActor`and then create a `WorkflowProfilerActor` (one per workflow) which is supposed to handle all the metadata information coming from the engine side for a particular workflow. The way it happens is based on the presumption that almost all the information that we needed was present in the `StateName` and `StateData` of our FSMs. Unfortunately, with Akka's `SubscribeTransitionalCallback` we can only monitor the FSM states, and not the data. So I've created a trait (which the Engine's FSMs can extend from) which provide the semantics of wrapping up the state and data of the FSM in a message, and publish it into Akka's event stream. The ProfilerActor is the listener of these events and handles them appropriately. With this, I was able to make the FSMs unaware of the MetadataServices, and simply publish it's state and data in the event stream while performing any transitions.~~\r\n\r\n~~Let me know if you guys have any (other?) ideas / suggestions.~~\r\n\r\nContents added to metadata with this PR:\r\n\r\n- [x] workflowName\r\n- [ ]  calls (To come from the backends)\r\n- [x] outputs \r\n- [x] id\r\n- [x] inputs\r\n- [x] submission\r\n- [x] status\r\n- [x] end\r\n- [x] start","created_at":"2016-05-12T21:45:16Z","updated_at":"2016-05-17T17:36:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4e2e2495512774fd46aeafcc8e02452364446d31","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/829/comments","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/78719e37877eb13f0c89f0d0365366c9238c4e9a","head":{"label":"broadinstitute:engineMetadata-develop","ref":"engineMetadata-develop","sha":"78719e37877eb13f0c89f0d0365366c9238c4e9a","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/cromwell/deployments","created_at":"2015-04-17T19:39:36Z","updated_at":"2016-05-16T15:37:13Z","pushed_at":"2016-05-17T17:20:07Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":7021,"stargazers_count":63,"watchers_count":63,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":118,"forks":13,"open_issues":118,"watchers":63,"default_branch":"0.19_hotfix"}},"base":{"label":"broadinstitute:develop","ref":"develop","sha":"0749adc319e865f0fb769e4cc91fd6e18a46ab58","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34136406,"name":"cromwell","full_name":"broadinstitute/cromwell","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/cromwell","description":"Workflow Execution Engine using WDL","fork":false,"url":"https://api.github.com/repos/broadinstitute/cromwell","forks_url":"https://api.github.com/repos/broadinstitute/cromwell/forks","keys_url":"https://api.github.com/repos/broadinstitute/cromwell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/cromwell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/cromwell/teams","hooks_url":"https://api.github.com/repos/broadinstitute/cromwell/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/cromwell/events","assignees_url":"https://api.github.com/repos/broadinstitute/cromwell/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/cromwell/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/cromwell/tags","blobs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/cromwell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/cromwell/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/cromwell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/cromwell/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/cromwell/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/cromwell/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/cromwell/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/cromwell/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/cromwell/subscription","commits_url":"https://api.github.com/repos/broadinstitute/cromwell/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/cromwell/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/cromwell/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/cromwell/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/cromwell/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/cromwell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/cromwell/merges","archive_url":"https://api.github.com/repos/broadinstitute/cromwell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/cromwell/downloads","issues_url":"https://api.github.com/repos/broadinstitute/cromwell/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/cromwell/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/cromwell/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/cromwell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/cromwell/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/cromwell/releases{/id}","deployments_url":"https://api.github.com/repos/broadinstitute/cromwell/deployments","created_at":"2015-04-17T19:39:36Z","updated_at":"2016-05-16T15:37:13Z","pushed_at":"2016-05-17T17:20:07Z","git_url":"git://github.com/broadinstitute/cromwell.git","ssh_url":"git@github.com:broadinstitute/cromwell.git","clone_url":"https://github.com/broadinstitute/cromwell.git","svn_url":"https://github.com/broadinstitute/cromwell","homepage":"","size":7021,"stargazers_count":63,"watchers_count":63,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"open_issues_count":118,"forks":13,"open_issues":118,"watchers":63,"default_branch":"0.19_hotfix"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829"},"html":{"href":"https://github.com/broadinstitute/cromwell/pull/829"},"issue":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/829"},"comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/issues/829/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/cromwell/pulls/829/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/cromwell/statuses/78719e37877eb13f0c89f0d0365366c9238c4e9a"}}}}