{"id":16928734,"url":"https://github.com/tasso94/nestjs-cambpm","last_synced_at":"2025-03-22T11:31:14.729Z","repository":{"id":57310115,"uuid":"286947785","full_name":"tasso94/nestjs-cambpm","owner":"tasso94","description":"Run your business logic anywhere.","archived":false,"fork":false,"pushed_at":"2021-10-16T04:04:14.000Z","size":933,"stargazers_count":16,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T11:03:50.485Z","etag":null,"topics":["camunda","nestjs","nodejs","workflow","workflow-automat"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/tasso94.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}},"created_at":"2020-08-12T07:32:51.000Z","updated_at":"2024-12-19T08:44:31.000Z","dependencies_parsed_at":"2022-09-04T09:10:28.907Z","dependency_job_id":null,"html_url":"https://github.com/tasso94/nestjs-cambpm","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/tasso94%2Fnestjs-cambpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tasso94%2Fnestjs-cambpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tasso94%2Fnestjs-cambpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tasso94%2Fnestjs-cambpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tasso94","download_url":"https://codeload.github.com/tasso94/nestjs-cambpm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244951376,"owners_count":20537372,"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":["camunda","nestjs","nodejs","workflow","workflow-automat"],"created_at":"2024-10-13T20:37:32.806Z","updated_at":"2025-03-22T11:31:13.721Z","avatar_url":"https://github.com/tasso94.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com\"\u003e\u003cimg src=\"https://nestjs.com/img/logo_text.svg\" alt=\"Nest Logo\" width=\"320\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# NestJS Connector for Camunda BPM Runtime\n\n\u003e Run your business logic anywhere\n\n## Install\n\n```\nnpm i nestjs-cambpm\n```\n\n## Example\n\nThe full example can be found [here]. Please also see the [Azure Function Example].\n\n[here]: https://github.com/tasso94/nestjs-cambpm/tree/master/examples/local-microservice\n[Azure Function Example]: https://github.com/tasso94/nestjs-cambpm/tree/master/examples/azure-microservice\n\n```typescript\n// src/main.ts\n\nasync function bootstrap() {\n  const app = await NestFactory.create(AppModule);\n  app.connectMicroservice({\n    strategy: app.get(ExternalTaskConnector),\n  });\n\n  await app.startAllMicroservicesAsync();\n}\nbootstrap();\n```\n\n```typescript\n// src/app.module.ts\n\n@Module({\n  controllers: [AppController],\n  providers: [\n    ExternalTaskConnector,\n    ExternalTaskModule.createClient({\n      baseUrl: 'http://localhost:8080/engine-rest',\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n```typescript\n// src/app.controller.ts\n\n@Controller()\nexport class AppController {\n  @Subscription('my-external-task', {\n    lockDuration: 500,\n  })\n  async myExternalTask(@Payload() task: Task, @Ctx() taskService: TaskService) {\n    const businessKey = task.businessKey;\n    const isBusinessKeyMissing = !businessKey;\n\n    const processVariables = new Variables();\n    processVariables.set('isBusinessKeyMissing', isBusinessKeyMissing);\n\n    if (!isBusinessKeyMissing) {\n      // Complete the External Task\n      await taskService.complete(task, processVariables);\n      Logger.log('External task successfully completed!');\n\n    } else {\n      const errorMessage = 'No business key given!';\n      const options: HandleFailureOptions = {\n        errorMessage: errorMessage,\n      };\n\n      // Raise an incident\n      await taskService.handleFailure(task, options);\n\n      Logger.error(errorMessage);\n    }\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftasso94%2Fnestjs-cambpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftasso94%2Fnestjs-cambpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftasso94%2Fnestjs-cambpm/lists"}