{"action":"created","comment":{"url":"https://api.github.com/repos/cstudioteam/handywedge/pulls/comments/127130517","pull_request_review_id":49681590,"id":127130517,"diff_hunk":"@@ -0,0 +1,457 @@\n+/*\n+ * Copyright (c) 2016 C Studio Co.,Ltd.\n+ *\n+ * This software is released under the MIT License.\n+ *\n+ * http://opensource.org/licenses/mit-license.php\n+ */\n+package com.handywedge.workflow;\n+\n+import java.sql.SQLException;\n+import java.sql.Timestamp;\n+import java.util.ArrayList;\n+import java.util.List;\n+import java.util.UUID;\n+\n+import javax.enterprise.context.ApplicationScoped;\n+import javax.inject.Inject;\n+\n+import com.handywedge.common.FWConstantCode;\n+import com.handywedge.common.FWRuntimeException;\n+import com.handywedge.context.FWFullContext;\n+import com.handywedge.log.FWLogger;\n+\n+@ApplicationScoped\n+public class FWWFManagerImpl implements FWWFManager {\n+\n+  private static final String ROLLBACK_ACTION_CODE = \"ROLLBACK_ACTION\";\n+  private static final String ROLLBACK_ACTION_NAME = \"否認\";\n+\n+  @Inject\n+  private FWLogger logger;\n+\n+  @Inject\n+  private FWFullContext ctx;\n+\n+  @Inject\n+  private FWWFService service;\n+\n+  @Override\n+  public FWWFStatus getStatus(String wfId) {\n+    long startTime = logger.perfStart(\"getStatus\");\n+    try {\n+      FWWFStatus status = null;\n+      if (wfId != null) {\n+        status = service.getStatus(wfId);\n+      }\n+      logger.debug(\"wfId={}\", wfId);\n+      logger.perfEnd(\"getStatus\", startTime);\n+      return status;\n+    } catch (SQLException e) {\n+      throw new FWRuntimeException(FWConstantCode.DB_FATAL, e);\n+    }\n+  }\n+\n+  @Override\n+  public FWWFAction getAction(String actionCode) {\n+    long startTime = logger.perfStart(\"getAction\");\n+    FWWFAction action = getAction(actionCode, ctx.getUser().getRole());\n+    logger.perfEnd(\"getAction\", startTime);\n+    return action;\n+  }\n+\n+  @Override\n+  public FWWFAction getActionInfo(String actionCode, String role) {\n+    long startTime = logger.perfStart(\"getActionInfo\");\n+    FWWFAction action = getAction(actionCode, role);\n+    logger.perfEnd(\"getActionInfo\", startTime);\n+    return action;\n+  }\n+\n+  private FWWFAction getAction(String actionCode, String role) {\n+    try {\n+      // 実行可能なアクション取得\n+      FWWFAction action = null;\n+      if (role != null) {\n+        action = service.getAction(actionCode, role);\n+      }\n+      logger.debug(\"role={}, actionCode={}\", role, actionCode);\n+      return action;\n+    } catch (SQLException e) {\n+      throw new FWRuntimeException(FWConstantCode.DB_FATAL, e);\n+    }\n+  }\n+\n+  @Override\n+  public List<FWWFAction> getActions(String wfId) {\n+    long startTime = logger.perfStart(\"getActions\");\n+    List<FWWFAction> actions = getActions(wfId, ctx.getUser().getRole());\n+    logger.perfEnd(\"getActions\", startTime);\n+    return actions;\n+  }\n+\n+  @Override\n+  public List<FWWFAction> getActionInfos(String wfId, String role) {\n+    long startTime = logger.perfStart(\"getActionInfos\");\n+    List<FWWFAction> actions = getActions(wfId, role);\n+    logger.perfEnd(\"getActionInfos\", startTime);\n+    return actions;\n+  }\n+\n+  private List<FWWFAction> getActions(String wfId, String role) {\n+    try {\n+      // 現在ステータス取得\n+      FWWFStatus status = null;\n+      if (wfId != null) {\n+        status = service.getStatus(wfId);\n+      }\n+      // 実行可能なアクションリスト取得\n+      List<FWWFAction> actions = new ArrayList<>();\n+      if (role != null) {","path":"handywedge-master/handywedge-core/src/main/java/com/handywedge/workflow/FWWFManagerImpl.java","position":110,"original_position":110,"commit_id":"297f9cbe95bfdde7792efb1e21ff5e39b86683dc","original_commit_id":"297f9cbe95bfdde7792efb1e21ff5e39b86683dc","user":{"login":"CSTUDIO-Yamamoto","id":7455242,"avatar_url":"https://avatars1.githubusercontent.com/u/7455242?v=3","gravatar_id":"","url":"https://api.github.com/users/CSTUDIO-Yamamoto","html_url":"https://github.com/CSTUDIO-Yamamoto","followers_url":"https://api.github.com/users/CSTUDIO-Yamamoto/followers","following_url":"https://api.github.com/users/CSTUDIO-Yamamoto/following{/other_user}","gists_url":"https://api.github.com/users/CSTUDIO-Yamamoto/gists{/gist_id}","starred_url":"https://api.github.com/users/CSTUDIO-Yamamoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CSTUDIO-Yamamoto/subscriptions","organizations_url":"https://api.github.com/users/CSTUDIO-Yamamoto/orgs","repos_url":"https://api.github.com/users/CSTUDIO-Yamamoto/repos","events_url":"https://api.github.com/users/CSTUDIO-Yamamoto/events{/privacy}","received_events_url":"https://api.github.com/users/CSTUDIO-Yamamoto/received_events","type":"User","site_admin":false},"body":"statusのnull避けが必要ですね。","created_at":"2017-07-13T05:22:38Z","updated_at":"2017-07-13T05:22:38Z","html_url":"https://github.com/cstudioteam/handywedge/pull/2#discussion_r127130517","pull_request_url":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/cstudioteam/handywedge/pulls/comments/127130517"},"html":{"href":"https://github.com/cstudioteam/handywedge/pull/2#discussion_r127130517"},"pull_request":{"href":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2","id":130285852,"html_url":"https://github.com/cstudioteam/handywedge/pull/2","diff_url":"https://github.com/cstudioteam/handywedge/pull/2.diff","patch_url":"https://github.com/cstudioteam/handywedge/pull/2.patch","issue_url":"https://api.github.com/repos/cstudioteam/handywedge/issues/2","number":2,"state":"open","locked":false,"title":"148717443 workflow","user":{"login":"CSTUDIO-Yamamoto","id":7455242,"avatar_url":"https://avatars1.githubusercontent.com/u/7455242?v=3","gravatar_id":"","url":"https://api.github.com/users/CSTUDIO-Yamamoto","html_url":"https://github.com/CSTUDIO-Yamamoto","followers_url":"https://api.github.com/users/CSTUDIO-Yamamoto/followers","following_url":"https://api.github.com/users/CSTUDIO-Yamamoto/following{/other_user}","gists_url":"https://api.github.com/users/CSTUDIO-Yamamoto/gists{/gist_id}","starred_url":"https://api.github.com/users/CSTUDIO-Yamamoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CSTUDIO-Yamamoto/subscriptions","organizations_url":"https://api.github.com/users/CSTUDIO-Yamamoto/orgs","repos_url":"https://api.github.com/users/CSTUDIO-Yamamoto/repos","events_url":"https://api.github.com/users/CSTUDIO-Yamamoto/events{/privacy}","received_events_url":"https://api.github.com/users/CSTUDIO-Yamamoto/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-13T04:47:30Z","updated_at":"2017-07-13T05:22:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"53771dda015511487fcdd6053356a1d5b438e9b0","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2/commits","review_comments_url":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2/comments","review_comment_url":"https://api.github.com/repos/cstudioteam/handywedge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cstudioteam/handywedge/issues/2/comments","statuses_url":"https://api.github.com/repos/cstudioteam/handywedge/statuses/297f9cbe95bfdde7792efb1e21ff5e39b86683dc","head":{"label":"cstudioteam:148717443_workflow","ref":"148717443_workflow","sha":"297f9cbe95bfdde7792efb1e21ff5e39b86683dc","user":{"login":"cstudioteam","id":16092343,"avatar_url":"https://avatars2.githubusercontent.com/u/16092343?v=3","gravatar_id":"","url":"https://api.github.com/users/cstudioteam","html_url":"https://github.com/cstudioteam","followers_url":"https://api.github.com/users/cstudioteam/followers","following_url":"https://api.github.com/users/cstudioteam/following{/other_user}","gists_url":"https://api.github.com/users/cstudioteam/gists{/gist_id}","starred_url":"https://api.github.com/users/cstudioteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstudioteam/subscriptions","organizations_url":"https://api.github.com/users/cstudioteam/orgs","repos_url":"https://api.github.com/users/cstudioteam/repos","events_url":"https://api.github.com/users/cstudioteam/events{/privacy}","received_events_url":"https://api.github.com/users/cstudioteam/received_events","type":"Organization","site_admin":false},"repo":{"id":50116787,"name":"handywedge","full_name":"cstudioteam/handywedge","owner":{"login":"cstudioteam","id":16092343,"avatar_url":"https://avatars2.githubusercontent.com/u/16092343?v=3","gravatar_id":"","url":"https://api.github.com/users/cstudioteam","html_url":"https://github.com/cstudioteam","followers_url":"https://api.github.com/users/cstudioteam/followers","following_url":"https://api.github.com/users/cstudioteam/following{/other_user}","gists_url":"https://api.github.com/users/cstudioteam/gists{/gist_id}","starred_url":"https://api.github.com/users/cstudioteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstudioteam/subscriptions","organizations_url":"https://api.github.com/users/cstudioteam/orgs","repos_url":"https://api.github.com/users/cstudioteam/repos","events_url":"https://api.github.com/users/cstudioteam/events{/privacy}","received_events_url":"https://api.github.com/users/cstudioteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cstudioteam/handywedge","description":null,"fork":false,"url":"https://api.github.com/repos/cstudioteam/handywedge","forks_url":"https://api.github.com/repos/cstudioteam/handywedge/forks","keys_url":"https://api.github.com/repos/cstudioteam/handywedge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cstudioteam/handywedge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cstudioteam/handywedge/teams","hooks_url":"https://api.github.com/repos/cstudioteam/handywedge/hooks","issue_events_url":"https://api.github.com/repos/cstudioteam/handywedge/issues/events{/number}","events_url":"https://api.github.com/repos/cstudioteam/handywedge/events","assignees_url":"https://api.github.com/repos/cstudioteam/handywedge/assignees{/user}","branches_url":"https://api.github.com/repos/cstudioteam/handywedge/branches{/branch}","tags_url":"https://api.github.com/repos/cstudioteam/handywedge/tags","blobs_url":"https://api.github.com/repos/cstudioteam/handywedge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cstudioteam/handywedge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cstudioteam/handywedge/git/refs{/sha}","trees_url":"https://api.github.com/repos/cstudioteam/handywedge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cstudioteam/handywedge/statuses/{sha}","languages_url":"https://api.github.com/repos/cstudioteam/handywedge/languages","stargazers_url":"https://api.github.com/repos/cstudioteam/handywedge/stargazers","contributors_url":"https://api.github.com/repos/cstudioteam/handywedge/contributors","subscribers_url":"https://api.github.com/repos/cstudioteam/handywedge/subscribers","subscription_url":"https://api.github.com/repos/cstudioteam/handywedge/subscription","commits_url":"https://api.github.com/repos/cstudioteam/handywedge/commits{/sha}","git_commits_url":"https://api.github.com/repos/cstudioteam/handywedge/git/commits{/sha}","comments_url":"https://api.github.com/repos/cstudioteam/handywedge/comments{/number}","issue_comment_url":"https://api.github.com/repos/cstudioteam/handywedge/issues/comments{/number}","contents_url":"https://api.github.com/repos/cstudioteam/handywedge/contents/{+path}","compare_url":"https://api.github.com/repos/cstudioteam/handywedge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cstudioteam/handywedge/merges","archive_url":"https://api.github.com/repos/cstudioteam/handywedge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cstudioteam/handywedge/downloads","issues_url":"https://api.github.com/repos/cstudioteam/handywedge/issues{/number}","pulls_url":"https://api.github.com/repos/cstudioteam/handywedge/pulls{/number}","milestones_url":"https://api.github.com/repos/cstudioteam/handywedge/milestones{/number}","notifications_url":"https://api.github.com/repos/cstudioteam/handywedge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cstudioteam/handywedge/labels{/name}","releases_url":"https://api.github.com/repos/cstudioteam/handywedge/releases{/id}","deployments_url":"https://api.github.com/repos/cstudioteam/handywedge/deployments","created_at":"2016-01-21T15:32:15Z","updated_at":"2017-06-27T08:39:22Z","pushed_at":"2017-07-13T04:47:30Z","git_url":"git://github.com/cstudioteam/handywedge.git","ssh_url":"git@github.com:cstudioteam/handywedge.git","clone_url":"https://github.com/cstudioteam/handywedge.git","svn_url":"https://github.com/cstudioteam/handywedge","homepage":null,"size":4855,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"cstudioteam:master","ref":"master","sha":"cae868da75b6d8c218488fc018ae93ba9db5b294","user":{"login":"cstudioteam","id":16092343,"avatar_url":"https://avatars2.githubusercontent.com/u/16092343?v=3","gravatar_id":"","url":"https://api.github.com/users/cstudioteam","html_url":"https://github.com/cstudioteam","followers_url":"https://api.github.com/users/cstudioteam/followers","following_url":"https://api.github.com/users/cstudioteam/following{/other_user}","gists_url":"https://api.github.com/users/cstudioteam/gists{/gist_id}","starred_url":"https://api.github.com/users/cstudioteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstudioteam/subscriptions","organizations_url":"https://api.github.com/users/cstudioteam/orgs","repos_url":"https://api.github.com/users/cstudioteam/repos","events_url":"https://api.github.com/users/cstudioteam/events{/privacy}","received_events_url":"https://api.github.com/users/cstudioteam/received_events","type":"Organization","site_admin":false},"repo":{"id":50116787,"name":"handywedge","full_name":"cstudioteam/handywedge","owner":{"login":"cstudioteam","id":16092343,"avatar_url":"https://avatars2.githubusercontent.com/u/16092343?v=3","gravatar_id":"","url":"https://api.github.com/users/cstudioteam","html_url":"https://github.com/cstudioteam","followers_url":"https://api.github.com/users/cstudioteam/followers","following_url":"https://api.github.com/users/cstudioteam/following{/other_user}","gists_url":"https://api.github.com/users/cstudioteam/gists{/gist_id}","starred_url":"https://api.github.com/users/cstudioteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstudioteam/subscriptions","organizations_url":"https://api.github.com/users/cstudioteam/orgs","repos_url":"https://api.github.com/users/cstudioteam/repos","events_url":"https://api.github.com/users/cstudioteam/events{/privacy}","received_events_url":"https://api.github.com/users/cstudioteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cstudioteam/handywedge","description":null,"fork":false,"url":"https://api.github.com/repos/cstudioteam/handywedge","forks_url":"https://api.github.com/repos/cstudioteam/handywedge/forks","keys_url":"https://api.github.com/repos/cstudioteam/handywedge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cstudioteam/handywedge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cstudioteam/handywedge/teams","hooks_url":"https://api.github.com/repos/cstudioteam/handywedge/hooks","issue_events_url":"https://api.github.com/repos/cstudioteam/handywedge/issues/events{/number}","events_url":"https://api.github.com/repos/cstudioteam/handywedge/events","assignees_url":"https://api.github.com/repos/cstudioteam/handywedge/assignees{/user}","branches_url":"https://api.github.com/repos/cstudioteam/handywedge/branches{/branch}","tags_url":"https://api.github.com/repos/cstudioteam/handywedge/tags","blobs_url":"https://api.github.com/repos/cstudioteam/handywedge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cstudioteam/handywedge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cstudioteam/handywedge/git/refs{/sha}","trees_url":"https://api.github.com/repos/cstudioteam/handywedge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cstudioteam/handywedge/statuses/{sha}","languages_url":"https://api.github.com/repos/cstudioteam/handywedge/languages","stargazers_url":"https://api.github.com/repos/cstudioteam/handywedge/stargazers","contributors_url":"https://api.github.com/repos/cstudioteam/handywedge/contributors","subscribers_url":"https://api.github.com/repos/cstudioteam/handywedge/subscribers","subscription_url":"https://api.github.com/repos/cstudioteam/handywedge/subscription","commits_url":"https://api.github.com/repos/cstudioteam/handywedge/commits{/sha}","git_commits_url":"https://api.github.com/repos/cstudioteam/handywedge/git/commits{/sha}","comments_url":"https://api.github.com/repos/cstudioteam/handywedge/comments{/number}","issue_comment_url":"https://api.github.com/repos/cstudioteam/handywedge/issues/comments{/number}","contents_url":"https://api.github.com/repos/cstudioteam/handywedge/contents/{+path}","compare_url":"https://api.github.com/repos/cstudioteam/handywedge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cstudioteam/handywedge/merges","archive_url":"https://api.github.com/repos/cstudioteam/handywedge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cstudioteam/handywedge/downloads","issues_url":"https://api.github.com/repos/cstudioteam/handywedge/issues{/number}","pulls_url":"https://api.github.com/repos/cstudioteam/handywedge/pulls{/number}","milestones_url":"https://api.github.com/repos/cstudioteam/handywedge/milestones{/number}","notifications_url":"https://api.github.com/repos/cstudioteam/handywedge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cstudioteam/handywedge/labels{/name}","releases_url":"https://api.github.com/repos/cstudioteam/handywedge/releases{/id}","deployments_url":"https://api.github.com/repos/cstudioteam/handywedge/deployments","created_at":"2016-01-21T15:32:15Z","updated_at":"2017-06-27T08:39:22Z","pushed_at":"2017-07-13T04:47:30Z","git_url":"git://github.com/cstudioteam/handywedge.git","ssh_url":"git@github.com:cstudioteam/handywedge.git","clone_url":"https://github.com/cstudioteam/handywedge.git","svn_url":"https://github.com/cstudioteam/handywedge","homepage":null,"size":4855,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2"},"html":{"href":"https://github.com/cstudioteam/handywedge/pull/2"},"issue":{"href":"https://api.github.com/repos/cstudioteam/handywedge/issues/2"},"comments":{"href":"https://api.github.com/repos/cstudioteam/handywedge/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/cstudioteam/handywedge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cstudioteam/handywedge/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/cstudioteam/handywedge/statuses/297f9cbe95bfdde7792efb1e21ff5e39b86683dc"}}}}
{"actor":{"display_login":"CSTUDIO-Yamamoto"}}