{"id":24552992,"url":"https://github.com/npdeehan/rest-error-to-bpmn-error","last_synced_at":"2025-03-16T14:15:10.492Z","repository":{"id":90222881,"uuid":"356203495","full_name":"NPDeehan/rest-error-to-bpmn-error","owner":"NPDeehan","description":"This example show how you can trigger a BPMN error if you done get the response you're expecting from a REST API that ","archived":false,"fork":false,"pushed_at":"2021-04-09T09:35:27.000Z","size":79,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T01:34:33.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NPDeehan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-09T08:54:15.000Z","updated_at":"2021-04-09T21:05:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"5752aa7b-6a14-4d84-86a1-acb8620fcdad","html_url":"https://github.com/NPDeehan/rest-error-to-bpmn-error","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPDeehan%2Frest-error-to-bpmn-error","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPDeehan%2Frest-error-to-bpmn-error/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPDeehan%2Frest-error-to-bpmn-error/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NPDeehan%2Frest-error-to-bpmn-error/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NPDeehan","download_url":"https://codeload.github.com/NPDeehan/rest-error-to-bpmn-error/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243878491,"owners_count":20362433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-23T01:33:47.130Z","updated_at":"2025-03-16T14:15:10.486Z","avatar_url":"https://github.com/NPDeehan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST Error to BPMN Error Example\nThis example show how you can trigger a BPMN error in Camunda if you don't get the response you're expecting from a REST API that \n\n## The Process\n\nThe process take an owner and reponame and tries to make a rest call to git hub to find the repo. By default the values are\n\n``repoOwner = octocat``\n``repoName = hello-world``\n\nIt will make the following rest call\n\n``https://api.github.com/repos/octocat/hello-world``\n\n![model]\n\nIf the response is 200 OK the process will continue the `Show Repo Details` task any other request type will trigger a BPMN error that move the process to the `Show Error` task. \n\n## The Code \n\nA java delegate will make the rest call\n```Java\n\n        Unirest.setTimeouts(0, 0);\n        HttpResponse\u003cString\u003e response = Unirest.get(\"https://api.github.com/repos/\" + repoOwner +  \"/\" + repoName)\n                .asString();\n\n```\n\nIt will then check the response and throw an error if anything but a 200 is returned \n\n```Java\n  if(response.getStatus() != 200){\n            throw new BpmnError(\"NO_REPO_FOUND\", \"Error making call - Repose Code: \"+response.getStatus());\n        }else{\n\n            execution.setVariable(\"repoResponse\", response.getStatusText());\n        }\n\n```\n\n[model]: ./src/main/resources/static/img/process.png","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpdeehan%2Frest-error-to-bpmn-error","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpdeehan%2Frest-error-to-bpmn-error","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpdeehan%2Frest-error-to-bpmn-error/lists"}