{"action":"created","issue":{"url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib/issues/301","repository_url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib","labels_url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib/issues/301/comments","events_url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib/issues/301/events","html_url":"https://github.com/TIBCOSoftware/flogo-contrib/pull/301","id":368424227,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxNjA2NTUw","number":301,"title":"Added mechanism to push flow and task events to registered listeners","user":{"login":"vijaynalawade","id":7453716,"node_id":"MDQ6VXNlcjc0NTM3MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7453716?v=4","gravatar_id":"","url":"https://api.github.com/users/vijaynalawade","html_url":"https://github.com/vijaynalawade","followers_url":"https://api.github.com/users/vijaynalawade/followers","following_url":"https://api.github.com/users/vijaynalawade/following{/other_user}","gists_url":"https://api.github.com/users/vijaynalawade/gists{/gist_id}","starred_url":"https://api.github.com/users/vijaynalawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijaynalawade/subscriptions","organizations_url":"https://api.github.com/users/vijaynalawade/orgs","repos_url":"https://api.github.com/users/vijaynalawade/repos","events_url":"https://api.github.com/users/vijaynalawade/events{/privacy}","received_events_url":"https://api.github.com/users/vijaynalawade/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"vijaynalawade","id":7453716,"node_id":"MDQ6VXNlcjc0NTM3MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7453716?v=4","gravatar_id":"","url":"https://api.github.com/users/vijaynalawade","html_url":"https://github.com/vijaynalawade","followers_url":"https://api.github.com/users/vijaynalawade/followers","following_url":"https://api.github.com/users/vijaynalawade/following{/other_user}","gists_url":"https://api.github.com/users/vijaynalawade/gists{/gist_id}","starred_url":"https://api.github.com/users/vijaynalawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijaynalawade/subscriptions","organizations_url":"https://api.github.com/users/vijaynalawade/orgs","repos_url":"https://api.github.com/users/vijaynalawade/repos","events_url":"https://api.github.com/users/vijaynalawade/events{/privacy}","received_events_url":"https://api.github.com/users/vijaynalawade/received_events","type":"User","site_admin":false},"assignees":[{"login":"vijaynalawade","id":7453716,"node_id":"MDQ6VXNlcjc0NTM3MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/7453716?v=4","gravatar_id":"","url":"https://api.github.com/users/vijaynalawade","html_url":"https://github.com/vijaynalawade","followers_url":"https://api.github.com/users/vijaynalawade/followers","following_url":"https://api.github.com/users/vijaynalawade/following{/other_user}","gists_url":"https://api.github.com/users/vijaynalawade/gists{/gist_id}","starred_url":"https://api.github.com/users/vijaynalawade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vijaynalawade/subscriptions","organizations_url":"https://api.github.com/users/vijaynalawade/orgs","repos_url":"https://api.github.com/users/vijaynalawade/repos","events_url":"https://api.github.com/users/vijaynalawade/events{/privacy}","received_events_url":"https://api.github.com/users/vijaynalawade/received_events","type":"User","site_admin":false}],"milestone":null,"comments":16,"created_at":"2018-10-09T22:31:42Z","updated_at":"2018-10-16T18:38:06Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib/pulls/301","html_url":"https://github.com/TIBCOSoftware/flogo-contrib/pull/301","diff_url":"https://github.com/TIBCOSoftware/flogo-contrib/pull/301.diff","patch_url":"https://github.com/TIBCOSoftware/flogo-contrib/pull/301.patch"},"body":"**What kind of change does this PR introduce?** (check one with \"x\")\r\n```\r\n[] Bugfix\r\n[x] Feature\r\n[] Code style update (formatting, local variables)\r\n[] Refactoring (no functional changes, no api changes)\r\n[] Other... Please describe:\r\n```\r\n\r\n**Fixes**: #\r\n\r\n**What is the current behavior?**\r\nFor flow action, currently there is no way to gather flow or task/activity events to build meaningful monitoring tools. \r\n**What is the new behavior?**\r\nWith this feature, developers can register event listeners and gather events to build different tooling. Note that aggregation of stats must be done the listener.  "},"comment":{"url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib/issues/comments/430350099","html_url":"https://github.com/TIBCOSoftware/flogo-contrib/pull/301#issuecomment-430350099","issue_url":"https://api.github.com/repos/TIBCOSoftware/flogo-contrib/issues/301","id":430350099,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDM1MDA5OQ==","user":{"login":"fm-tibco","id":17088380,"node_id":"MDQ6VXNlcjE3MDg4Mzgw","avatar_url":"https://avatars1.githubusercontent.com/u/17088380?v=4","gravatar_id":"","url":"https://api.github.com/users/fm-tibco","html_url":"https://github.com/fm-tibco","followers_url":"https://api.github.com/users/fm-tibco/followers","following_url":"https://api.github.com/users/fm-tibco/following{/other_user}","gists_url":"https://api.github.com/users/fm-tibco/gists{/gist_id}","starred_url":"https://api.github.com/users/fm-tibco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fm-tibco/subscriptions","organizations_url":"https://api.github.com/users/fm-tibco/orgs","repos_url":"https://api.github.com/users/fm-tibco/repos","events_url":"https://api.github.com/users/fm-tibco/events{/privacy}","received_events_url":"https://api.github.com/users/fm-tibco/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T18:38:06Z","updated_at":"2018-10-16T18:38:06Z","author_association":"COLLABORATOR","body":"Ok, I'm using some pseudo code to help review and point out some concerns.   (using interfaces to simplify).  This isn't a suggest implementation, but put there to help summarize and review. \r\n\r\n```\r\ntype FlowEventListener func(FlowEventContext, *FlowEvent)\r\ntype TaskEventListener func(TaskEventContext, *TaskEvent)\r\n\r\n//since an engine only runs one app (do we ever envision more, my vote is no - complicates\r\n// things for no reason). APP name and version can be acquired else where if needed  \r\n// app.Name()  app.Version() for example\r\n\r\n// could be object or interface.  Interface would make sense if it just encomposed the \r\n// \"static\" data, which could be provided by Instance for example.\r\ntype FlowEventContext interface {\r\n\tName() string\r\n   \tID() string\r\n   \t\r\n   \tParentName() string\r\n\tParentID() string\r\n\r\n\t// these need to be snapshotted on event creation - you might have inconsistent \r\n        // data if you have multiple handlers\r\n\tStatus() FlowStatus\r\n\tError()\r\n\r\n\t// possible optimization, these could be snapshotted if a listener \"told us\" that\r\n        // it needs them\r\n\tInput() map[string]interface{}\r\n\tOutput() map[string]interface{}\r\n\r\n\tWorkingData() map[string]interface{} //not completely sold on this yet\r\n}\r\n\r\n\r\ntype FlowEvent struct {\r\n\teventType string //current PR's status\r\n\ttimestamp time.Time\r\n}\r\n\r\n// could be object or interface.  Interface would make sense if it just encompassed the \r\n// \"static\" data, which could be provided by the Task for example.\r\ntype TaskEventContext interface {\r\n\tName() string\r\n   \tID() string\r\n   \t\r\n\tFlowName() string\r\n   \tFlowID() string\r\n   \t\r\n   \tType() string\r\n\r\n   \tParentName() string\r\n\tParentID() string\r\n\r\n\t// these need to be snapshotted on event creation - you might have inconsistent \r\n        // data if you have multiple handlers\r\n\tStatus() TaskStatus // actual code (is this needed or rely on \"event type\")\r\n\tError()\r\n\r\n\t// possible optimization, these could be snapshotted if a listener \"told us\" that\r\n        // it needs them\r\n\tInput() map[string]interface{}  \r\n\tOutput() map[string]interface{}\r\n\r\n\tWorkingData() map[string]interface{} //not completely sold on this yet\r\n}\r\n\r\ntype TaskEvent struct {\r\n\teventType string   //current PR's status\r\n\ttimestamp time.Time\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"fm-tibco"}}