{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/product-pc/pulls/comments/47600482","id":47600482,"diff_hunk":"@@ -820,6 +820,117 @@ public String getSucessorPredecessorSubprocessList(String resourcePath){\n         return resourceString;\n     }\n \n+    public String addSubprocess(String subprocessDetails){\n+        try{\n+            RegistryService registryService = ProcessCenterServerHolder.getInstance().getRegistryService();\n+\n+            if(registryService != null){\n+                UserRegistry reg = registryService.getGovernanceSystemRegistry();\n+\n+                JSONObject processInfo = new JSONObject(subprocessDetails);\n+                String processName = processInfo.getString(\"processName\");\n+                String processVersion = processInfo.getString(\"processVersion\");\n+                JSONArray subprocessList = processInfo.getJSONArray(\"subprocessList\");\n+\n+                String processAssetPath = \"processes/\" + processName + \"/\" + processVersion;\n+                Resource resource = reg.get(processAssetPath);\n+                String processContent = new String((byte[]) resource.getContent());\n+                Document doc = stringToXML(processContent);\n+\n+                if(subprocessList.length() != 0){\n+                    Element rootElement = doc.getDocumentElement();\n+                    for(int i = 0 ; i < subprocessList.length() ; i++){\n+                        Element successorElement = append(doc, rootElement, \"subprocess\", mns);\n+                        appendText(doc, successorElement, \"name\", mns, subprocessList.getJSONObject(i).getString(\"name\"));\n+                        appendText(doc, successorElement, \"path\", mns, subprocessList.getJSONObject(i).getString(\"path\"));\n+                        appendText(doc, successorElement, \"id\", mns, subprocessList.getJSONObject(i).getString(\"id\"));\n+                    }\n+                    String newProcessContent = xmlToString(doc);\n+                    resource.setContent(newProcessContent);\n+                    reg.put(processAssetPath, resource);\n+                }\n+            }\n+\n+        }catch (Exception e){\n+            log.error(e);\n+        }\n+        return \"OK\";\n+    }","path":"modules/components/core/org.wso2.carbon.pc.core/src/main/java/org/wso2/carbon/pc/core/ProcessStore.java","position":39,"original_position":39,"commit_id":"2e4b67c4dff3cab414e347229e073fe235cb53ec","original_commit_id":"2e4b67c4dff3cab414e347229e073fe235cb53ec","user":{"login":"isurusuranga","id":1329800,"avatar_url":"https://avatars.githubusercontent.com/u/1329800?v=3","gravatar_id":"","url":"https://api.github.com/users/isurusuranga","html_url":"https://github.com/isurusuranga","followers_url":"https://api.github.com/users/isurusuranga/followers","following_url":"https://api.github.com/users/isurusuranga/following{/other_user}","gists_url":"https://api.github.com/users/isurusuranga/gists{/gist_id}","starred_url":"https://api.github.com/users/isurusuranga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isurusuranga/subscriptions","organizations_url":"https://api.github.com/users/isurusuranga/orgs","repos_url":"https://api.github.com/users/isurusuranga/repos","events_url":"https://api.github.com/users/isurusuranga/events{/privacy}","received_events_url":"https://api.github.com/users/isurusuranga/received_events","type":"User","site_admin":false},"body":"fixed in https://github.com/wso2/product-pc/pull/34","created_at":"2015-12-15T06:26:50Z","updated_at":"2015-12-15T06:26:50Z","html_url":"https://github.com/wso2/product-pc/pull/21#discussion_r47600482","pull_request_url":"https://api.github.com/repos/wso2/product-pc/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/wso2/product-pc/pulls/comments/47600482"},"html":{"href":"https://github.com/wso2/product-pc/pull/21#discussion_r47600482"},"pull_request":{"href":"https://api.github.com/repos/wso2/product-pc/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/product-pc/pulls/21","id":48330456,"html_url":"https://github.com/wso2/product-pc/pull/21","diff_url":"https://github.com/wso2/product-pc/pull/21.diff","patch_url":"https://github.com/wso2/product-pc/pull/21.patch","issue_url":"https://api.github.com/repos/wso2/product-pc/issues/21","number":21,"state":"closed","locked":false,"title":"Implemented the update functionality","user":{"login":"isurusuranga","id":1329800,"avatar_url":"https://avatars.githubusercontent.com/u/1329800?v=3","gravatar_id":"","url":"https://api.github.com/users/isurusuranga","html_url":"https://github.com/isurusuranga","followers_url":"https://api.github.com/users/isurusuranga/followers","following_url":"https://api.github.com/users/isurusuranga/following{/other_user}","gists_url":"https://api.github.com/users/isurusuranga/gists{/gist_id}","starred_url":"https://api.github.com/users/isurusuranga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isurusuranga/subscriptions","organizations_url":"https://api.github.com/users/isurusuranga/orgs","repos_url":"https://api.github.com/users/isurusuranga/repos","events_url":"https://api.github.com/users/isurusuranga/events{/privacy}","received_events_url":"https://api.github.com/users/isurusuranga/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-21T13:25:43Z","updated_at":"2015-12-15T06:26:50Z","closed_at":"2015-10-21T16:23:34Z","merged_at":"2015-10-21T16:23:34Z","merge_commit_sha":"0cb6cf06c74de096fd76090f9473c79dda6cb80f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wso2/product-pc/pulls/21/commits","review_comments_url":"https://api.github.com/repos/wso2/product-pc/pulls/21/comments","review_comment_url":"https://api.github.com/repos/wso2/product-pc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/product-pc/issues/21/comments","statuses_url":"https://api.github.com/repos/wso2/product-pc/statuses/2e4b67c4dff3cab414e347229e073fe235cb53ec","head":{"label":"isurusuranga:process_center","ref":"process_center","sha":"2e4b67c4dff3cab414e347229e073fe235cb53ec","user":{"login":"isurusuranga","id":1329800,"avatar_url":"https://avatars.githubusercontent.com/u/1329800?v=3","gravatar_id":"","url":"https://api.github.com/users/isurusuranga","html_url":"https://github.com/isurusuranga","followers_url":"https://api.github.com/users/isurusuranga/followers","following_url":"https://api.github.com/users/isurusuranga/following{/other_user}","gists_url":"https://api.github.com/users/isurusuranga/gists{/gist_id}","starred_url":"https://api.github.com/users/isurusuranga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isurusuranga/subscriptions","organizations_url":"https://api.github.com/users/isurusuranga/orgs","repos_url":"https://api.github.com/users/isurusuranga/repos","events_url":"https://api.github.com/users/isurusuranga/events{/privacy}","received_events_url":"https://api.github.com/users/isurusuranga/received_events","type":"User","site_admin":false},"repo":{"id":44361035,"name":"product-pc","full_name":"isurusuranga/product-pc","owner":{"login":"isurusuranga","id":1329800,"avatar_url":"https://avatars.githubusercontent.com/u/1329800?v=3","gravatar_id":"","url":"https://api.github.com/users/isurusuranga","html_url":"https://github.com/isurusuranga","followers_url":"https://api.github.com/users/isurusuranga/followers","following_url":"https://api.github.com/users/isurusuranga/following{/other_user}","gists_url":"https://api.github.com/users/isurusuranga/gists{/gist_id}","starred_url":"https://api.github.com/users/isurusuranga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isurusuranga/subscriptions","organizations_url":"https://api.github.com/users/isurusuranga/orgs","repos_url":"https://api.github.com/users/isurusuranga/repos","events_url":"https://api.github.com/users/isurusuranga/events{/privacy}","received_events_url":"https://api.github.com/users/isurusuranga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/isurusuranga/product-pc","description":"","fork":true,"url":"https://api.github.com/repos/isurusuranga/product-pc","forks_url":"https://api.github.com/repos/isurusuranga/product-pc/forks","keys_url":"https://api.github.com/repos/isurusuranga/product-pc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/isurusuranga/product-pc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/isurusuranga/product-pc/teams","hooks_url":"https://api.github.com/repos/isurusuranga/product-pc/hooks","issue_events_url":"https://api.github.com/repos/isurusuranga/product-pc/issues/events{/number}","events_url":"https://api.github.com/repos/isurusuranga/product-pc/events","assignees_url":"https://api.github.com/repos/isurusuranga/product-pc/assignees{/user}","branches_url":"https://api.github.com/repos/isurusuranga/product-pc/branches{/branch}","tags_url":"https://api.github.com/repos/isurusuranga/product-pc/tags","blobs_url":"https://api.github.com/repos/isurusuranga/product-pc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/isurusuranga/product-pc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/isurusuranga/product-pc/git/refs{/sha}","trees_url":"https://api.github.com/repos/isurusuranga/product-pc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/isurusuranga/product-pc/statuses/{sha}","languages_url":"https://api.github.com/repos/isurusuranga/product-pc/languages","stargazers_url":"https://api.github.com/repos/isurusuranga/product-pc/stargazers","contributors_url":"https://api.github.com/repos/isurusuranga/product-pc/contributors","subscribers_url":"https://api.github.com/repos/isurusuranga/product-pc/subscribers","subscription_url":"https://api.github.com/repos/isurusuranga/product-pc/subscription","commits_url":"https://api.github.com/repos/isurusuranga/product-pc/commits{/sha}","git_commits_url":"https://api.github.com/repos/isurusuranga/product-pc/git/commits{/sha}","comments_url":"https://api.github.com/repos/isurusuranga/product-pc/comments{/number}","issue_comment_url":"https://api.github.com/repos/isurusuranga/product-pc/issues/comments{/number}","contents_url":"https://api.github.com/repos/isurusuranga/product-pc/contents/{+path}","compare_url":"https://api.github.com/repos/isurusuranga/product-pc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/isurusuranga/product-pc/merges","archive_url":"https://api.github.com/repos/isurusuranga/product-pc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/isurusuranga/product-pc/downloads","issues_url":"https://api.github.com/repos/isurusuranga/product-pc/issues{/number}","pulls_url":"https://api.github.com/repos/isurusuranga/product-pc/pulls{/number}","milestones_url":"https://api.github.com/repos/isurusuranga/product-pc/milestones{/number}","notifications_url":"https://api.github.com/repos/isurusuranga/product-pc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/isurusuranga/product-pc/labels{/name}","releases_url":"https://api.github.com/repos/isurusuranga/product-pc/releases{/id}","created_at":"2015-10-16T03:51:48Z","updated_at":"2015-10-16T03:51:50Z","pushed_at":"2015-12-15T06:16:50Z","git_url":"git://github.com/isurusuranga/product-pc.git","ssh_url":"git@github.com:isurusuranga/product-pc.git","clone_url":"https://github.com/isurusuranga/product-pc.git","svn_url":"https://github.com/isurusuranga/product-pc","homepage":null,"size":9212,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"wso2:master","ref":"master","sha":"908e11ea9196aac71f19be29f5894d71a06758a1","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":25909621,"name":"product-pc","full_name":"wso2/product-pc","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/product-pc","description":"","fork":false,"url":"https://api.github.com/repos/wso2/product-pc","forks_url":"https://api.github.com/repos/wso2/product-pc/forks","keys_url":"https://api.github.com/repos/wso2/product-pc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/product-pc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/product-pc/teams","hooks_url":"https://api.github.com/repos/wso2/product-pc/hooks","issue_events_url":"https://api.github.com/repos/wso2/product-pc/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/product-pc/events","assignees_url":"https://api.github.com/repos/wso2/product-pc/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/product-pc/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/product-pc/tags","blobs_url":"https://api.github.com/repos/wso2/product-pc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/product-pc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/product-pc/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/product-pc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/product-pc/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/product-pc/languages","stargazers_url":"https://api.github.com/repos/wso2/product-pc/stargazers","contributors_url":"https://api.github.com/repos/wso2/product-pc/contributors","subscribers_url":"https://api.github.com/repos/wso2/product-pc/subscribers","subscription_url":"https://api.github.com/repos/wso2/product-pc/subscription","commits_url":"https://api.github.com/repos/wso2/product-pc/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/product-pc/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/product-pc/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/product-pc/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/product-pc/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/product-pc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/product-pc/merges","archive_url":"https://api.github.com/repos/wso2/product-pc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/product-pc/downloads","issues_url":"https://api.github.com/repos/wso2/product-pc/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/product-pc/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/product-pc/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/product-pc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/product-pc/labels{/name}","releases_url":"https://api.github.com/repos/wso2/product-pc/releases{/id}","created_at":"2014-10-29T07:33:38Z","updated_at":"2015-11-08T22:55:21Z","pushed_at":"2015-12-15T06:16:50Z","git_url":"git://github.com/wso2/product-pc.git","ssh_url":"git@github.com:wso2/product-pc.git","clone_url":"https://github.com/wso2/product-pc.git","svn_url":"https://github.com/wso2/product-pc","homepage":null,"size":9231,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":1,"forks":6,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/product-pc/pulls/21"},"html":{"href":"https://github.com/wso2/product-pc/pull/21"},"issue":{"href":"https://api.github.com/repos/wso2/product-pc/issues/21"},"comments":{"href":"https://api.github.com/repos/wso2/product-pc/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/product-pc/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/product-pc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/product-pc/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/product-pc/statuses/2e4b67c4dff3cab414e347229e073fe235cb53ec"}}}}